Contents

  1. Getting Started
  2. Configuration
  3. Agent Capabilities
  4. CLI Reference
  5. Building from Source
  6. Contributing

Getting Started

Install the client and send your first message

Install via APT (Debian / Ubuntu)

Add the signing key, source list, and install in one flow:

sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://packages.avalynn.ai/key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/avalynn.gpg
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/avalynn.gpg] https://packages.avalynn.ai stable main" | sudo tee /etc/apt/sources.list.d/avalynn.list
sudo apt update && sudo apt install avacli

Install from tarball

Download the tarball for your architecture from the Download page, then extract and run the installer:

tar xzf avacli-latest-linux-x86_64.tar.gz
cd avacli-*
sudo ./install.sh

Connect xAI

Open-source avacli talks to the xAI API directly. Add your key once via CLI or the Settings page in the web UI:

API key avacli --set-api-key xai-YOUR_KEY

Stored under ~/.avacli/config.json. Alternatively set XAI_API_KEY in the environment.

Start the web UI

Launch the local agent interface in your browser:

Web UI avacli serve

Default bind http://0.0.0.0:8080 (override with --host / --port). Run avacli --generate-master-key once to set the admin password.

CLI chat

Send a one-shot prompt without starting the web UI:

Chat avacli chat "hello"

Sends the message and prints the agent response to stdout (requires API key).

Client Configuration

Modes, keys, workspace, and model selection

Web UI configuration

Most settings can also be configured through the built-in web UI at http://localhost:8080 (or your chosen port). Open the Settings page in the sidebar to set your API key, choose a model, configure billing, and change the workspace directory — no CLI flags required.

Direct xAI usage

avacli always uses the xAI API with your own key (CLI, environment, or Settings in the web UI). It does not proxy chat through the Avalynn platform or consume platform tokens.

Setting API keys

Ways to provide your xAI key to avacli:

xAI key avacli --set-api-key xai-xxxxxxxxxxxx

Saves to ~/.avacli/config.json.

Environment export XAI_API_KEY=xai-xxxxxxxxxxxx

Takes precedence when set.

Web UI Settings → API key

Persisted under ~/.avacli/ alongside other preferences.

Workspace directory

Point the agent at a specific project directory for file operations and code analysis:

Workspace avacli --workspace /home/user/my-project serve

Short form: -d /path. The agent scopes file reads and writes to this directory.

Port configuration

Override the default web UI port (8080):

Custom port avacli serve --port 9090

The web UI will be available at http://localhost:9090 (or your host bind).

Model selection

Choose which xAI model to use for completions:

Model avacli --model grok-4-1-reasoning serve

Use avacli --list-models to see all available models.

Agent Capabilities

What the agent can do

File operations

The agent can read, write, and search files within the configured workspace. It respects .gitignore patterns and applies size limits to prevent reading excessively large files.

Code analysis & project awareness

When pointed at a project directory, the agent indexes the file tree and understands project structure, dependencies, and language-specific patterns. It can navigate codebases, find definitions, and suggest contextual edits.

Streaming responses with reasoning

Responses stream token-by-token in real time. When the model uses extended thinking, the reasoning trace is displayed in a collapsible block above the final answer so you can follow the agent's chain of thought.

Tool execution pipeline

The agent follows a tool-use loop: it receives your message, decides which tools to invoke (file read, file write, search, shell commands), executes them, and feeds the results back into the model for the next step. This continues until the task is complete or the model decides no more tool calls are needed.

Available tools (28)

The agent has access to the following tools. Availability depends on the active mode (see mode table below).

ToolDescription
read_fileRead the full contents of a file in the workspace.
write_fileWrite or overwrite a file in the workspace.
edit_fileApply targeted edits (search & replace) to a file.
undo_editRevert the last edit made to a file.
list_directoryList files and directories at a given path.
glob_filesFind files matching a glob pattern.
search_filesSearch file contents with regex or text patterns.
read_urlFetch and read the contents of a URL.
web_searchSearch the web and return summarized results.
x_searchSearch posts on X (Twitter).
run_shellExecute a shell command in the workspace.
run_testsRun the project's test suite.
add_memory / search_memoryStore and retrieve agent memories.
read_todos / create_update_todoManage to-do items.
generate_image / edit_imageGenerate or edit images from text prompts.
generate_videoGenerate a video from a text prompt.
ask_userPrompt the user for clarification or input.

Tool availability by mode

Not all tools are available in every mode:

ModeRead-onlyWriteShell & testsMedia
QuestionYes
PlanYesYes
AgentYesYesYesYes

CLI Reference

Quick command reference
CommandDescription
avacli serveStart the embedded web UI (default when run with no args).
avacli chat "msg"One-shot chat — send a message, print the response, and exit.
avacli --set-api-key KEYSave an xAI API key to ~/.avacli/config.json.
avacli --generate-master-keyCreate a random admin password for the web UI.
avacli --workspace DIR serveRun with a specific working directory for file tools.
avacli --list-modelsShow xAI models available to your API key.
avacli --port 9090 serveOverride the default web UI port (8080).
avacli login / logoutManage CLI session auth against the master password.

Run avacli --help for the full list of flags and options.

Building from Source

Compile avacli yourself

Prerequisites

You need a C++17 compiler, CMake 3.16+, and a few system libraries:

sudo apt install build-essential cmake libcurl4-openssl-dev libssl-dev libjsoncpp-dev

Build

git clone https://github.com/iBerry420/acos.git
cd acos
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . -j$(nproc)

The resulting avacli binary is in build/. Copy it to /usr/local/bin/ or run it directly.

Supported platforms

  • Linux — x86_64 and ARM64 (primary target).
  • macOS — Intel and Apple Silicon (CI builds planned).
  • Windows — MSVC / MinGW (experimental, CI builds planned).

Contributing

Help improve avacli

avacli is MIT-licensed and welcomes contributions. The repository lives at github.com/iBerry420/acos.

  • Issues — report bugs or request features on the GitHub issue tracker.
  • Pull requests — fork the repo, create a branch, and open a PR against main.
  • Code style — follow the existing patterns in the codebase. Use clang-format if available.
  • Testing — make sure cmake --build . -j passes before submitting.