Agentclash cli setup

From agentclash/agentclash · View interactive version

Agentclash cli setup is an AI agent skill from the GitHub repository agentclash/agentclash. Use when configuring the AgentClash CLI, authenticating with device login or tokens, selecting a workspace, saving default config with link, creating project config with init, resolving API URL precedence, or diagnosing CLI access against production, local, or self-hosted backends.

How to use this skill

Skill file

AgentClash CLI Setup

Purpose

Configure an AgentClash CLI session that can reach the intended backend, authenticate safely, resolve the right workspace, and pass agentclash doctor before a user starts authoring packs or running evals.

Use When

Do Not Use When

Inputs Needed

Environment

Use hosted production by default:

export AGENTCLASH_API_URL="https://api.agentclash.dev"

Use a local backend only when the user is explicitly running the API server locally:

export AGENTCLASH_API_URL="http://localhost:8080"

For CI or other non-interactive shells, provide a token through the environment instead of running browser login:

export AGENTCLASH_TOKEN="<token>"
export AGENTCLASH_WORKSPACE="<workspace-id>"

Do not print token values in chat, logs, docs, or committed files.

Config And Precedence

API URL resolution:

--api-url > AGENTCLASH_API_URL > saved user config > default

The source-build default is http://localhost:8080. Released CLI builds stamp the production default at release time, but skills should still set AGENTCLASH_API_URL="https://api.agentclash.dev" explicitly for hosted workflows so copied commands behave the same in source and released builds.

Workspace resolution:

--workspace / -w > AGENTCLASH_WORKSPACE > project .agentclash.yaml > saved user config

Organization resolution for commands that need an org:

AGENTCLASH_ORG > project .agentclash.yaml > saved user config

Auth token resolution:

AGENTCLASH_TOKEN > stored CLI credentials

Saved user config lives at:

~/.config/agentclash/config.yaml

Project-local config lives in .agentclash.yaml and is discovered by walking up from the current directory. It can store workspace_id and org_id.

Procedure

  1. Choose the backend. For normal hosted work, export AGENTCLASH_API_URL="https://api.agentclash.dev" first.
  2. Verify the CLI is callable with agentclash version or, from the repo cli/ directory, go run . version.
  3. Authenticate. Prefer agentclash auth login --device for remote shells; use AGENTCLASH_TOKEN for CI.
  4. Check the authenticated identity with agentclash auth status.
  5. Select a workspace with agentclash link for the guided flow, or agentclash workspace use <workspace-id> when the ID is already known. Both commands write saved user config.
  6. If this repository should carry its own workspace binding, run agentclash init --workspace-id <workspace-id> --org-id <organization-id> from the project root.
  7. Run agentclash doctor to verify install, auth, workspace, challenge-pack visibility, deployment visibility, and baseline readiness.
  8. Report the effective backend, auth state, workspace, doctor result, and the next command the user should run.

Commands

Hosted production, interactive setup:

export AGENTCLASH_API_URL="https://api.agentclash.dev"
agentclash version
agentclash auth login --device
agentclash auth status
agentclash link
agentclash doctor

Hosted production when the workspace ID is already known:

export AGENTCLASH_API_URL="https://api.agentclash.dev"
agentclash auth login --device
agentclash workspace use <workspace-id>
agentclash doctor

Workspace discovery when an organization must be explicit:

export AGENTCLASH_API_URL="https://api.agentclash.dev"
agentclash workspace list --org <organization-id>
agentclash workspace get <workspace-id>
agentclash workspace use <workspace-id>

Project-local config for a repository:

agentclash init --workspace-id <workspace-id> --org-id <organization-id>

CI or non-interactive setup:

export AGENTCLASH_API_URL="https://api.agentclash.dev"
export AGENTCLASH_TOKEN="<token>"
export AGENTCLASH_WORKSPACE="<workspace-id>"
agentclash doctor --json

Local development from the CLI module:

cd cli
export AGENTCLASH_API_URL="http://localhost:8080"
go run . auth login --device
go run . link
go run . doctor

One-off backend override without changing saved config:

agentclash --api-url http://localhost:8080 doctor

Introspect the full command tree, flags, and stable exit codes as

machine-readable JSON (no auth required) — prefer this over scraping --help:

agentclash schema --json

Expected Output

Failure Modes

Safety Notes

Report Back Format

Backend: <effective API URL>
Auth: <ok | action needed> (<source: AGENTCLASH_TOKEN | stored credentials | none>)
Workspace: <workspace-id or none>
Doctor: <ready | warnings> - <short check summary>
Next command: <single recommended command>
Notes: <config precedence, local override, or token caveat if relevant>

Related Skills

Related Docs

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.