Skip to main content

CLI

@agentskit/cli provides terminal commands for interactive chat (Ink), one-shot agent runs (headless runtime), and starter projects. It reads optional project config from .agentskit.config.json via loadConfig.

When to use

  • You want a quick terminal chat without building a custom Ink app.
  • You run automation or CI tasks with agentskit run <task> and flags (no separate script file required).
  • You bootstrap React or Ink starters with agentskit init.

Installation

npm install -g @agentskit/cli
# or
npx @agentskit/cli --help

Config file (optional)

If present, .agentskit.config.json is merged into defaults (unless --no-config). loadConfig resolves it from the current working directory.

Typical fields include default provider and model for chat and run commands.

agentskit chat

Interactive terminal UI using @agentskit/ink.

agentskit chat [options]
OptionDescription
--provider <name>demo, anthropic, openai, … (default: demo)
--model <id>Model id for the provider
--api-key <key>Override env-based API key
--base-url <url>Custom API base URL
--system <prompt>System prompt
--memory <path>File path for file-backed history (default: .agentskit-history.json)
--memory-backend <backend>file (default) or sqlite
--tools <list>Comma-separated: web_search, filesystem, shell
--skill <list>Comma-separated built-in skill names (see @agentskit/skills)
--no-configSkip .agentskit.config.json

API keys: ANTHROPIC_API_KEY, OPENAI_API_KEY, etc., depending on provider.

agentskit chat --provider anthropic --model claude-sonnet-4-6 --tools web_search

agentskit run

Execute a single task through createRuntime and print the final assistant text to stdout.

agentskit run <task> [options]
agentskit run --task "Summarize this" [options]
OptionDescription
--task <text>Task string if not passed as the first positional argument
--provider, --model, --api-key, --base-urlSame as chat
--tools <list>Comma-separated tools
--skill <name>Single skill
--skills <list>Comma-separated skills (composed); mutually exclusive with --skill
--memory <path>Persistence path when using file/sqlite memory
--memory-backend <backend>file (default) or sqlite
--system-prompt <text>Override default system prompt
--max-steps <n>ReAct cap (default: 10)
--verboseLog agent events to stderr
--prettyRich Ink progress UI
--no-configSkip config file
agentskit run "What is 2+2?" --provider openai --model gpt-4o --verbose

There is no agentskit run ./script.ts mode in the current CLI — invoke your own TypeScript entrypoints with node/tsx and createRuntime instead.

agentskit init

Scaffold a starter project.

agentskit init [options]
OptionDefaultDescription
--template <react|ink>reactStack for the starter
--dir <path>agentskit-starterOutput directory (resolved from cwd)
agentskit init --template react --dir my-chat
cd my-chat && npm install && npm run dev

Environment variables

VariableUsed for
ANTHROPIC_API_KEYAnthropic
OPENAI_API_KEYOpenAI
REDIS_URLIf you wire Redis memory in custom code (not default CLI file memory)

Troubleshooting

IssueMitigation
task is requiredPass a string after run or use --task.
--skill and --skills both setCLI exits with error — use only one.
Provider auth errorsExport the correct *_API_KEY or pass --api-key.
Wrong defaultsCheck .agentskit.config.json or pass --no-config.

See also

Start here · Packages · TypeDoc (@agentskit/cli) · Quick Start · Ink · Runtime · Eval