Metadata-Version: 2.5
Name: stackai
Version: 0.5.0
Summary: Interactive AI agent CLI for StackAI.
Project-URL: Homepage, https://www.stack-ai.com
Project-URL: Repository, https://github.com/StackAI/stack-cli
Project-URL: Issues, https://github.com/StackAI/stack-cli/issues
Author-email: StackAI <arosinol@stack-ai.com>
License-Expression: MIT
License-File: LICENSE
Keywords: ai,cli,stackai,workflows
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Requires-Dist: anthropic>=0.69.0
Requires-Dist: textual>=0.80.0
Requires-Dist: typer>=0.12.0
Description-Content-Type: text/markdown

# stackai

An interactive AI agent in your terminal — like Claude Code, for [StackAI](https://www.stack-ai.com).

## Installation

```bash
pip install stackai
```

This installs the `stack` command.

## The interactive agent

Just run `stack` (or `stack chat`) to start an interactive session:

```bash
stack
```

On a real terminal this opens a **full-screen app** (scrolling transcript +
anchored input, à la Claude Code). Piped/non-interactive input falls back to a
line REPL automatically; force it with `stack chat --classic`.

You get a streaming chat loop with **tool use** — the agent can read files,
list directories, and run shell commands (with your approval) to help answer
your questions. Responses render as Markdown with syntax-highlighted code
blocks; extended thinking is streamed inline.

```
› what does pyproject.toml configure?

stack ⚙ read_file pyproject.toml
      … reads the file, then explains it
```

### Slash commands

| Command            | Description                              |
| ------------------ | ---------------------------------------- |
| `/help`            | show available commands                  |
| `/clear`           | reset the conversation                   |
| `/tools`           | list the tools the agent can call        |
| `/backend <name>`  | switch backend (`anthropic` \| `stackai`)|
| `/exit`, `/quit`   | leave                                    |

### Backends

The agent is backend-pluggable. Default is **Anthropic** (Claude); you can also
point it at a deployed **StackAI** workflow.

**Anthropic** (default) — set a key and go:

```bash
export ANTHROPIC_API_KEY=sk-ant-...
stack                          # or: stack chat -b anthropic -m claude-opus-4-8
```

**StackAI** — call one of your deployed workflows:

```bash
stack config set backend stackai
stack config set stackai_url  https://api.stack-ai.com/inference/v0/run/<org>/<flow>
stack config set stackai_api_key <key>
stack
```

Config is stored at `~/.config/stackai/config.json`. Relevant keys:
`backend`, `model`, `anthropic_api_key`, `stackai_url`, `stackai_api_key`,
`stackai_input_field` (default `in-0`), `stackai_output_field` (default `outputs`).

## Other commands

```bash
stack --version
stack hello [name]
stack config set|get|list|path
```

## Development

This project uses [uv](https://docs.astral.sh/uv/).

```bash
uv sync                   # install deps into a local venv
uv run stack              # run the agent from source
uv run pytest             # run the test suite
```

## Building & publishing

```bash
uv build                  # produces wheel + sdist in dist/
uv publish                # upload to PyPI
```

## License

MIT
