Documentation

Authentication

Set up your Personal Access Token for ARKA Code CLI

ARKA Code CLI requires a Personal Access Token to authenticate with the ARKA AI API. This guide walks you through creating a token and configuring the CLI.

Pro Subscription Required

ARKA Code CLI is a Pro feature. You'll need an active Pro subscription to use the CLI. Tokens are tied to your account, so your subscription status is automatically verified.

Creating a Personal Access Token

1

Open the Tokens Page

Navigate to Settings → Personal Access Tokens in your ARKA AI workspace, or go directly to arka-ai.com/app/personal/settings/tokens

Personal Access Tokens page

The Personal Access Tokens management page

2

Create a New Token

Click the Create Token button. Give your token a descriptive name (e.g., "MacBook Pro", "Work Laptop", or "CI/CD Pipeline"). Optionally set an expiration date for added security.

Create token modal

Enter a name for your token and optionally set an expiration

3

Copy Your Token

After creation, your token will be displayed once. Copy it immediately and store it securely. You won't be able to see the full token again.

Token created successfully

Copy your token now - it won't be shown again!

Keep Your Token Secure

  • Never share your token publicly or commit it to version control
  • Treat it like a password - anyone with your token has full API access
  • If compromised, revoke it immediately from the tokens page
  • Consider setting an expiration date for tokens used in shared environments

Using the Login Command

The easiest way to authenticate is using the arka login command. It will open your browser to the tokens page and prompt you to paste your token.

Terminal
$arka login
ARKA Code Login Opening browser to generate a Personal Access Token... https://arka-ai.com/app/personal/settings/tokens If the browser didn't open, visit the URL above manually. Steps: 1. Sign in to ARKA AI (if not already) 2. Click "Create Token" 3. Copy the token (starts with arka_) 4. Paste it below Paste your token here:
arka_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Validating token...
Login successful! You can now use ARKA Code. Run `arka` to start.

Your token is securely stored in the config file at ~/.config/arka-code-nodejs/config.json (location may vary by OS).

Alternative: Environment Variable

You can also set your token as an environment variable. This is useful for CI/CD pipelines or when you don't want to store the token in a config file.

~/.bashrc or ~/.zshrc
export ARKA_API_KEY=arka_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Or pass it directly when running the CLI:

Terminal
$arka --api-key arka_xxxxx

Logging Out

To clear your stored credentials, use the logout command:

Terminal
$arka logout
Are you sure you want to log out? [y/N]:
y
Logged out successfully. Run `arka login` to sign in again.

Revoking Tokens

If you suspect a token has been compromised or you no longer need it, revoke it immediately from the tokens page. Click the trash icon next to any token to delete it.

Revoking a token is immediate and irreversible. Any applications or scripts using that token will stop working.

Troubleshooting

Invalid Token

If you see "Invalid token" or "Unauthorized", verify that:

  • Your token starts with arka_
  • You copied the complete token without extra spaces
  • The token hasn't been revoked or expired

Pro Subscription Required

If you see "Pro subscription required", your account doesn't have an active Pro subscription. Visit arka-ai.com/billing to upgrade.

Multiple Tokens

You can create multiple tokens for different devices or purposes. Each token can be revoked independently, so if one device is lost or compromised, you only need to revoke that specific token.