Skip to content

Commit bfad2c7

Browse files
authored
Merge pull request #202 from tcdent/docs-catchup
Update CLI docs to reflect current command state and `uv` integration
2 parents 6bcbe71 + 0b730a3 commit bfad2c7

File tree

1 file changed

+117
-24
lines changed

1 file changed

+117
-24
lines changed

docs/cli-reference/cli.mdx

Lines changed: 117 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,57 +8,150 @@ It all starts with calling
88
$ agentstack
99
```
1010

11-
## `$ init | i`
11+
### Shortcut Aliases
12+
Many top-level AgentStack commands can be invoked using a single-letter prefix to save keystrokes. These are indicated
13+
in the command's documentation here after a `|` character. Run `agentstack help` for the full list.
14+
15+
### Global Flags
16+
These flags work with all commands:
17+
18+
`--debug` - Print a full traceback when an error is encountered. This also enables printing additional debug information
19+
from within AgentStack useful for development and debugging.
20+
21+
`--path=<path>` - Set the working directory of the current AgentStack project. By default `agentstack` works inside of the
22+
current directory and looks for an `agentstack.json` file there. By passing a path to this flag you can work on a project
23+
from outside of it's directory.
24+
25+
`--version` - Prints the current version and exits.
26+
27+
28+
## `$ agentstack init`
1229
This initializes a new AgentStack project.
1330
```bash
1431
agentstack init <slug_name>
1532
```
1633

17-
- `slug_name` (optional | str) - the name of your project
18-
- `--no-wizard` (boolean flag) - skips the wizard step and applies default values to project init
34+
`slug_name` is the name of your project, and will be created as a directory to initialize your project inside. When the
35+
default arguments are passed, a starter project template will be used, which adds a single agent, a single task and
36+
demonstrates the use of a tool.
1937

20-
## `$ generate | g`
38+
### Init Creates a Virtual Environment
39+
AgentStack creates a new directory, initializes a new virtual environment, installs dependencies, and populates the project
40+
structure. After `init` completes, `cd` into the directory, activate the virtual environment with `source .venv/bin/activate`.
41+
Virtual environments and package management are handled by the `uv` package manager.
42+
43+
### Initializing with the Wizard
44+
You can pass the `--wizard` flag to `agentstack init` to use an interactive project configuration wizard.
45+
46+
### Initializing from a Template
47+
You can also pass a `--template=<template_name>` argument to `agentstack init` which will pre-populate your project with functionality
48+
from a built-in template, or one found on the internet. A `template_name` can be one of three identifiers:
49+
50+
- A built-in AgentStack template (see the `templates/proj_templates` directory in the AgentStack repo for bundled templates).
51+
- A template file from the internet; pass the full https URL of the template.
52+
- A local template file; pass an absolute or relative path.
53+
54+
55+
## `$ agentstack run`
56+
This runs your AgentStack project.
57+
```bash
58+
agentstack run
59+
```
60+
61+
Environment variables will be loaded from `~/.env` and from the `.env` file inside your project directory. Make sure you
62+
have enabled your project's `venv` before executing to include all dependencies required.
63+
64+
### Overriding Inputs
65+
Your project defines Inputs which are used to customize the Agent and Task prompts for a specific task. In cases where
66+
using the `inputs.yaml` file to populate data is not flexible enough, `run` can accept value overrides for all defined
67+
inputs. Use `--input-<input_key>=<input_value>` to pass data which will only be used on this run.
68+
69+
For example, if you have a key in your `inputs.yaml` file named `topic` and want to override it for this run, you would
70+
use the following command:
71+
72+
```bash
73+
agentstack run --input-topic=Sports
74+
```
75+
76+
### Running other project commands
77+
By default, `run` will call the `main()` function inside your project's `main.py` file. You can pass alternate function
78+
names to run with `--function=<function_name>`.
79+
80+
81+
## Generate
2182
Code generation commands for automatically creating new agents or tasks.
2283

23-
### `agent | a`
84+
### `$ agentstack generate agent | agentstack g a`
2485
Generate a new agent
2586
- `agent_name` (required | str) - the name of the agent
2687
- `--role` (optional | str) - Prompt parameter: The role of the agent
2788
- `--goal` (optional | str) - Prompt parameter: The goal of the agent
2889
- `--backstory` (optional | str) - Prompt parameter: The backstory of the agent
2990
- `--llm` (optional | `<provider>/<model>`) - Which model to use for this agent
3091

31-
### `task | t`
92+
#### Default LLM
93+
All arguments to generate a new Agent are optional. A default LLM can be configured in `agentstack.json`under the
94+
`default_model` setting to populate a provider/model. If you are generating an agent in a project which does not have
95+
a default model set, you will be prompted to configure one.
96+
97+
#### Example
98+
```bash Generate Agent
99+
agentstack generate agent script_writer
100+
```
101+
102+
### `$ agentstack generate task | agentstack g t`
32103
Generate a new task
33104
- `task_name` (required | str) - the name of the task
34105
- `--description` (optional | str) - Prompt parameter: Explain the task in detail
35106
- `--expected_output` (optional | str) - What is the expected output from the agent (ex: data in json format)
36107
- `--agent` (optional | str) - The name of the agent of which to assign the task to (when using Crew in sequential mode)
37108

38-
### Examples
109+
#### Example
110+
```bash Generate Task
111+
agentstack g t gen_script --description "Write a short film script about secret agents"
112+
```
39113

40-
<CodeGroup>
41-
```bash Generate Agent
42-
agentstack generate agent script_writer
114+
## Tools
115+
Tools are what make AgentStack powerful. Adding and removing Tools from Agents is easy with this command.
116+
117+
### `$ agentstack tools list | agentstack t l`
118+
Lists all tools available in AgentStack.
119+
120+
### `$ agentstack tools add | agentstack t a`
121+
Shows an interactive interface for selecting which Tool to add and which Agents to add it to.
122+
123+
#### Add a Tool to all Agents
124+
When a tool_name is provided it will be made available to all Agents in the project.
125+
```bash
126+
$ agentstack tools add <tool_name>
43127
```
44128

45-
```bash Generate Task
46-
agentstack g t gen_script --description Write a short film script about secret agents
129+
#### Add a Tool to a single Agent
130+
When an agent_name is provided, the tool will be made available to only that agent.
131+
```bash
132+
$ agentstack tools add <tool_name> --agent=<agent_name>
47133
```
48-
</CodeGroup>
49134

135+
#### Add a Tool to multiple Agents
136+
When a comma-separated list of Agents is passed, the tool will be made available to those agents.
137+
```bash
138+
$ agentstack tools add <tool_name> --agents=<agent_name>,<agent_name>,<agent_name>
139+
```
50140

51-
## `$ tools | t`
52-
Tools are what make AgentStack powerful. Adding tools is easy with this command.
141+
### `$ agentstack tools remove <tool_name>`
142+
Removes a tool from all Agents in the project.
53143

54-
### `list | l`
55-
Lists all tools available in AgentStack.
56144

57-
### `add | a`
58-
Add a tool by name. By default, this command adds all tools from the provider to every agent.
59-
- `name` (required | str) - The name of the tool to add
145+
## Templates
146+
Projects can be exported into a template to facilitate sharing configurations. Re-initialize a project from a template
147+
with `agentstack init --template=<filename>`.
148+
149+
### `$ agentstack export <filename>`
150+
The current project will be written to a JSON template at the provided filename.
151+
152+
## `$ agentstack update`
153+
Check for updates and allow the user to install the latest release of AgentStack.
154+
155+
## `$ agentstack login`
156+
Authenticate with [agentstack.sh](https://agentstack.sh) for hosted integrations.
60157

61-
### Examples
62-
```bash
63-
agentstack tools add browserbase
64-
```

0 commit comments

Comments
 (0)