<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rashed Iqbal</title>
    <description>The latest articles on DEV Community by Rashed Iqbal (@rashed_iqbal).</description>
    <link>https://dev.to/rashed_iqbal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1030843%2Fcb7d967d-610e-4354-9877-7135d82dccc1.jpeg</url>
      <title>DEV Community: Rashed Iqbal</title>
      <link>https://dev.to/rashed_iqbal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rashed_iqbal"/>
    <language>en</language>
    <item>
      <title>Switch Claude Code providers in seconds with claude-provider (Plugin + CLI)</title>
      <dc:creator>Rashed Iqbal</dc:creator>
      <pubDate>Mon, 02 Feb 2026 22:49:22 +0000</pubDate>
      <link>https://dev.to/rashed_iqbal/switch-claude-code-providers-in-seconds-with-claude-provider-plugin-cli-3719</link>
      <guid>https://dev.to/rashed_iqbal/switch-claude-code-providers-in-seconds-with-claude-provider-plugin-cli-3719</guid>
      <description>&lt;p&gt;If you use Claude Code in your terminal but you sometimes need a different provider (or a different key/model), you’ve probably done this dance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;open &lt;code&gt;~/.claude/settings.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;change base URL / key / model&lt;/li&gt;
&lt;li&gt;pray you don’t break something 😅&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;claude-provider&lt;/code&gt; fixes that by giving you profiles + one-command switching — and you can use it in two ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;as a Claude Code plugin (slash commands inside Claude Code)&lt;/li&gt;
&lt;li&gt;as a CLI tool (interactive menu or quick switch)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What it does (in simple words)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Save provider configs as profiles&lt;/li&gt;
&lt;li&gt;Switch profiles instantly&lt;/li&gt;
&lt;li&gt;Comes with presets for popular providers, plus custom profiles&lt;/li&gt;
&lt;li&gt;Keeps things safer: masks API keys in output and locks down file permissions&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Install
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -g claude-provider
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This installs both the CLI + the plugin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 1: Use it inside Claude Code (Plugin)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Install the plugin from a marketplace
&lt;/h3&gt;

&lt;p&gt;In Claude Code, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/plugin marketplace add iqbal-rashed/claude-provider-plugin
/plugin install provider@claude-provider-plugin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Useful plugin commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/provider:add &amp;lt;name&amp;gt;
/provider:list
/provider:switch &amp;lt;profile_name&amp;gt;
/provider:snapshot &amp;lt;name&amp;gt;
/provider:delete &amp;lt;profile_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;add&lt;/code&gt; lets you pick a preset (or custom), enter API key, and optionally a model&lt;/p&gt;

&lt;p&gt;&lt;code&gt;snapshot&lt;/code&gt; saves your current ~/.claude/settings.json as a reusable profile&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 2: Use it in your terminal (CLI)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Interactive menu (easy mode)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cpr
# or
claude-provider
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This opens a menu to view/switch/add/edit/delete profiles.&lt;/p&gt;

&lt;h3&gt;
  
  
  Quick switch (fast mode)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cpr kimi
# or
claude-provider kimi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  List providers
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cpr -l
# or
claude-provider --list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  A real “daily use” example
&lt;/h3&gt;

&lt;p&gt;Let’s say you want 2 profiles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;work → Anthropic (main)&lt;/li&gt;
&lt;li&gt;fast → DeepSeek (cheap/quick)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  1) Add both profiles (plugin way)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/provider:add work
/provider:add fast

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pick presets, add keys, done.&lt;/p&gt;

&lt;h3&gt;
  
  
  2) Switch depending on task
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/provider:switch fast
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use it for quick refactors/tests.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/provider:switch work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use it for bigger code reviews.&lt;/p&gt;

&lt;h3&gt;
  
  
  Supported presets (built in)
&lt;/h3&gt;

&lt;p&gt;The predefined presets like Anthropic, Z.ai (GLM), MiniMax, Kimi, Qwen, DeepSeek, plus Custom.&lt;/p&gt;

&lt;h3&gt;
  
  
  How it works (why it feels instant)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Profiles are saved as: ~/.claude/settings..json&lt;/li&gt;
&lt;li&gt;Switching copies that file into: ~/.claude/settings.json&lt;/li&gt;
&lt;li&gt;Your enabled Claude Code plugins stay enabled when switching&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>claudecode</category>
      <category>cli</category>
    </item>
    <item>
      <title>Why I use rswitch instead of long switch blocks</title>
      <dc:creator>Rashed Iqbal</dc:creator>
      <pubDate>Mon, 02 Feb 2026 22:31:53 +0000</pubDate>
      <link>https://dev.to/rashed_iqbal/why-i-use-rswitch-instead-of-long-switch-blocks-3ef9</link>
      <guid>https://dev.to/rashed_iqbal/why-i-use-rswitch-instead-of-long-switch-blocks-3ef9</guid>
      <description>&lt;p&gt;Big &lt;code&gt;switch&lt;/code&gt; statements get messy fast: lots of &lt;code&gt;case&lt;/code&gt;, &lt;code&gt;break&lt;/code&gt;, and repeated code.&lt;br&gt;
&lt;code&gt;rswitch&lt;/code&gt; is a small library that lets you write the same logic in a cleaner way. You match a value and get the result from an object.&lt;/p&gt;

&lt;p&gt;Install&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i rswitch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Basic idea&lt;/p&gt;

&lt;p&gt;You give &lt;code&gt;rswitch&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a key (the value you want to check)&lt;/li&gt;
&lt;li&gt;a cases object (what to return for each case)&lt;/li&gt;
&lt;li&gt;an optional options object&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Simple example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import rswitch from "rswitch";

const role = "dev";

const result = rswitch(role, {
  designer: "Designer",
  "dev, web": "Freelancer", // match many keys
  "": "Unknown",            // default case
});

console.log(result); // Freelancer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Tip: "" (empty string) is the default case.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Example 1: Handle status codes (clean and clear)
import rswitch from "rswitch";

function statusMessage(code) {
  return rswitch(code, {
    "200, 201, 204": "✅ Success",
    "400, 401, 403": "⛔ Client error",
    "500, 502, 503": "🔥 Server error",
    "": "🤷 Unknown status",
  });
}

console.log(statusMessage(503)); // 🔥 Server error
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No &lt;code&gt;break&lt;/code&gt;, no fall-through, easy to read.&lt;/p&gt;

&lt;p&gt;Example 2: Run functions as actions&lt;/p&gt;

&lt;p&gt;Actions can be values or functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import rswitch from "rswitch";

const command = "build";

const result = rswitch(command, {
  build: () =&amp;gt; "Building...",
  test: () =&amp;gt; "Testing...",
  "": () =&amp;gt; "Use: build or test",
});

console.log(result); // Building...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why &lt;code&gt;rswitch&lt;/code&gt; is better than &lt;code&gt;switch&lt;/code&gt; (for many cases)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Short code&lt;/li&gt;
&lt;li&gt;Easy to read&lt;/li&gt;
&lt;li&gt;Group multiple cases like "dev, web"&lt;/li&gt;
&lt;li&gt;Default case is simple: ""&lt;/li&gt;
&lt;li&gt;Works great in JavaScript + TypeScript&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your switch is getting long, rswitch can make it cleaner.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>programming</category>
      <category>node</category>
    </item>
    <item>
      <title>How to Handle Outside Clicks in React with TypeScript</title>
      <dc:creator>Rashed Iqbal</dc:creator>
      <pubDate>Mon, 27 Feb 2023 11:32:07 +0000</pubDate>
      <link>https://dev.to/rashed_iqbal/how-to-handle-outside-clicks-in-react-with-typescript-4lmc</link>
      <guid>https://dev.to/rashed_iqbal/how-to-handle-outside-clicks-in-react-with-typescript-4lmc</guid>
      <description>&lt;p&gt;React is a powerful library for building web applications, but sometimes you need to handle events that occur outside of your components. This can be tricky because React's event handling is based on a component hierarchy, and events outside that hierarchy are not automatically detected.&lt;/p&gt;

&lt;p&gt;There are several libraries out there that can help you handle outside clicks, such as &lt;a href="https://www.npmjs.com/package/outsideclick-react" rel="noopener noreferrer"&gt;outsideclick-react&lt;/a&gt;. However, in this tutorial, we will show you how to implement your own hook to handle outside clicks in React using TypeScript.&lt;/p&gt;

&lt;p&gt;To create a custom hook that listens for outside clicks, we can make use of the useRef and useEffect hooks provided by React. Here's an example implementation of the useOutsideClick hook:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useEffect, useRef } from 'react';

export const useOutsideClick = (callback: () =&amp;gt; void) =&amp;gt; {
  const ref = useRef&amp;lt;HTMLDivElement&amp;gt;(null);

  useEffect(() =&amp;gt; {
    const handleClickOutside = (event: MouseEvent | TouchEvent) =&amp;gt; {
      if (ref.current &amp;amp;&amp;amp; !ref.current.contains(event.target as Node)) {
        callback();
      }
    };

    document.addEventListener('mouseup', handleClickOutside);
    document.addEventListener('touchend', handleClickOutside);


    return () =&amp;gt; {
      document.removeEventListener('mouseup', handleClickOutside);
      document.removeEventListener('touchend', handleClickOutside);
    };
  }, [callback]);

  return ref;
};

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this implementation, the &lt;code&gt;useOutsideClick&lt;/code&gt; hook takes a callback function as an argument, which will be triggered when a click event occurs outside of the specified element.&lt;/p&gt;

&lt;p&gt;The hook returns a &lt;code&gt;ref&lt;/code&gt; object, which can be attached to the root element of the component that needs to listen for outside clicks. When a click event occurs outside of this element, the &lt;code&gt;callback&lt;/code&gt; function will be triggered.&lt;/p&gt;

&lt;p&gt;Here's an example usage of the &lt;code&gt;useOutsideClick&lt;/code&gt; hook:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useOutsideClick } from './useOutsideClick';

export const MyComponent = () =&amp;gt; {
  const ref = useOutsideClick(() =&amp;gt; {
    console.log('Clicked outside of MyComponent');
  });

  return (
    &amp;lt;div ref={ref}&amp;gt;
      My Component
    &amp;lt;/div&amp;gt;
  );
};

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;useOutsideClick&lt;/code&gt; hook is used to create a &lt;code&gt;ref&lt;/code&gt; object, which is then passed to the root element of &lt;code&gt;MyComponent&lt;/code&gt;. When the user clicks outside of &lt;code&gt;MyComponent&lt;/code&gt;, the &lt;code&gt;console.log&lt;/code&gt; statement in the callback function will be triggered.&lt;/p&gt;

&lt;p&gt;By using the &lt;code&gt;useOutsideClick&lt;/code&gt; hook, you can easily handle clicks outside of a specific element in your React components. This provides a simple and effective way to handle events that occur outside of the React component hierarchy.&lt;/p&gt;

</description>
      <category>web3</category>
      <category>blockchain</category>
      <category>performance</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
