Building Async Agents with Continue CLI
Continue CLI brings continuous AI to your terminal. Generate smart commits, run parallel analysis, and automate coding workflows with AI agents.

If you’re doing the same task every day, repetitive work, that could be a good sign that it should be automated. Not just automated in the "write a script and forget it" way, but automated in the "intelligent agent that understands context and makes decisions" way.
With cn
, the Continue CLI, developers have access to a powerful, programmable interface for building and interacting with asynchronous (async) coding agents from the terminal that can automate repetitive or complex coding tasks.
What Are Async Agents?
Async agents allow you to perform multiple AI-driven, code-related operations concurrently, without blocking your main workflow. Think of them as intelligent background workers that can handle complex tasks while you focus on other priorities.
These agents can handle background tasks or tedious refactors without stalling your most important work. This enables faster feedback loops, more responsive developer tools, and entirely new automation workflows that weren't possible before.
Traditional scripts follow predetermined paths. They can't adapt, can't reason, and definitely can't understand the nuance of your codebase the way a developer would. That’s why async agents are essential for a Continuous AI future.
Building Async Agents in Continue CLI

Continue CLI cn
is a command-line tool that provides an agent that can understand your codebase, make intelligent decisions, and execute complex workflows while you focus on the bigger picture.
Continue CLI supports async functionality at its core. Whether you're running in headless ("scripted") mode or using the Terminal UI, agent actions are handled using asynchronous JavaScript/TypeScript patterns.
This means you can:
- Chain tool calls: Have the agent call code analysis, search, or file manipulation tools asynchronously within the same session
- Run parallel sessions: Launch multiple CLI instances simultaneously to handle different tasks concurrently
Getting Started with Continue CLI

# Install globally
npm i -g @continuedev/cli
# Interactive mode for complex tasks
cn
# Headless mode for automation
cn -p "Generate a conventional commit name for the current git changes"
That second command is where the magic happens. You can integrate Continue CLI into any workflow, script, or automation pipeline.
Real-World Async Workflows
Here are some ways to use async agents in your daily development work:
1. Smart Commit Message Generation
Instead of writing generic commit messages, you can pipe your git diff directly to Continue CLI:
echo "$(git diff) Generate a conventional commit name for the current git changes" | cn -p > commit-message.txt
The agent analyzes the actual changes and generates semantic, meaningful commit messages. No more "fix stuff" or "updates" cluttering your git history.
2. Parallel Processing for Speed
You can achieve parallel processing by launching several CLI instances using background jobs in your shell:
cn -p "Generate test cases for src/*.ts" > test-cases.txt &
cn -p "Document all exported functions in src/utils.ts" > documentation.md &
cn -p "Generate a summary of all recent git changes in this repo." > changelog.txt &
wait
Each cn session operates independently, with asynchronous operations within each session and parallel execution across multiple sessions, streaming results as they become available. This approach can dramatically speed up batch operations that would normally run sequentially.
3. Background Refactoring
For large refactoring tasks, describe what you want and let the agent work while you handle other priorities:
cn -p "Refactor the authentication middleware to use the new JWT library, maintaining backward compatibility"
Each cn
session operates independently and asynchronously, streaming results as they are available.
Under the Hood: Async Code Patterns
The CLI uses async/await throughout its agent orchestration. For example, when the agent invokes tools (search, file read, etc.), they are generally implemented as async functions so they don’t block the overall process:
// Example: Tool invocation is async
public async runTool(name: string, args: Record<string, any>) {
// ... connect to tool server ...
return await connection.client.callTool({ name, arguments: args });
}
Streaming chat responses utilize async iterators and Promises, enabling token-by-token feedback and background job management:
finalResponse = await streamChatResponse(chatHistory, model, llmApi, abortController);
// Response is streamed asynchronously
A lot of these async behaviors are implemented "under the hood." Within each CLI session, agent commands and SDK interactions are non-blocking, and responses are streamed using async iterators and Promises. For broader parallelization, you can run multiple CLI processes simultaneously using shell scripting, enhancing your overall developer experience.
While true in-process multi-agent workflows may be something for future releases, today's async tool calls within sessions and multiple process capabilities provide robust async functionality for most development workflows.
The Permission System: Trust but Verify
Continue CLI implements a granular permission system with sensible defaults. The agent starts with minimal default permissions:
- Read-only tools (like Read, List, Search, Diff): Automatically allowed
- Write operations (like Write, Edit): Require confirmation (ask)
- Terminal commands (Bash): Require confirmation (ask)
- Unknown tools: Default to asking for permission
You can override these defaults to control exactly what the agent can do:
# Always allow file writing
cn --allow Write
# Ask before running any curl commands
cn --ask Bash
# Never use write operations
cn --exclude Write
This gives you the confidence to let agents work asynchronously without worrying about unintended consequences.
Use Case: Continuous AI Workflows
The async-first architecture of Continue CLI makes it a perfect fit for:
- Continuous Integration (CI): Use the CLI in CI pipelines to lint, summarize, or refactor code as new commits land.
- Developer Scripts: Batch up multiple prompts asynchronously to speed up doc generation, refactoring, and code review.
- Continuous Code Monitoring: Build custom agents or tools that watch for code changes and trigger async agent jobs, without locking up your workflow.
For example, in a CI pipeline:
# Parallel analysis in CI
cn -p "Analyze security vulnerabilities in the current diff" > security-report.md &
cn -p "Generate performance impact summary for these changes" > performance-report.md &
cn -p "Create migration guide if breaking changes detected" > migration-guide.md &
wait
Configuration That Actually Makes Sense
Continue CLI uses the same config.yaml as the IDE extensions, which means you can:
- Share configurations across your entire development environment
- Switch between different agent profiles with /config
- Leverage Continue Hub for pre-built configurations
- Customize models, rules, and tools exactly how you want them
# Use a specific configuration
cn --config <path>
# Apply rules from the hub
cn --rule nate/spanish # Agent will respond in Spanish
Getting Started: A Practical Approach
If you want to explore async agents with cn
, here's how to get started:
- Install and experiment with interactive mode first: Run
cn
and ask it to help with a small task in your current project - Try simple async commands: Start with commit message generation or code analysis using the -p flag
- Experiment with parallel processing: Try running multiple CLI instances in background to see the speed improvements
- Gradually expand permissions: As you get comfortable, allow more tool usage
- Integrate into existing workflows: Add Continue CLI commands to your scripts, git hooks, or CI/CD pipelines
Async agents—and tools like the Continue CLI that leverage them—are redefining the developer workflow. By enabling non-blocking, programmable automation at the command line (continuous AI), you can scale your productivity and build richer integrations.
Try the Continue CLI, cn
, today for your next async automation project