Metadata-Version: 2.4
Name: corethink
Version: 1.0.2
Summary: The CoreThink Workbench from your terminal: environments, training, endpoints and more.
Author-email: CoreThink <support@corethink.ai>
License-Expression: MIT
Project-URL: Homepage, https://corethink.ai
Project-URL: Documentation, https://corethink.ai/docs/workbench-cli
Project-URL: Reference, https://corethink.ai/docs/workbench-cli-reference
Project-URL: Console, https://workbench.corethink.ai
Keywords: corethink,workbench,llm,agents,cli,training
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx<1,>=0.27
Requires-Dist: rich<16,>=13.7
Requires-Dist: typer<1,>=0.12

# CoreThink CLI

The [CoreThink Workbench](https://workbench.corethink.ai) from your terminal. Build environments, train programs around
small models, check them against the base model, release them and call them — everything the Workbench console does,
scriptable.

```bash
pipx install corethink       # or: uv tool install corethink
corethink login              # opens your browser to approve this terminal
corethink env list
```

Python 3.10 or newer, on Linux, macOS and Windows. **Docs:** [guide](https://corethink.ai/docs/workbench-cli) ·
[every command](https://corethink.ai/docs/workbench-cli-reference)

## Install

| Where | How |
| --- | --- |
| Your machine | `pipx install corethink` or `uv tool install corethink` |
| A virtual environment, conda, Docker or CI | `pip install corethink` |
| Upgrade | `pipx upgrade corethink`, `uv tool upgrade corethink` or `pip install -U corethink` |

`error: externally-managed-environment` from pip means your system Python (recent Ubuntu, Debian, Fedora, Homebrew)
does not take packages: use pipx or uv as above. On Ubuntu: `sudo apt install pipx && pipx ensurepath`.

## Quick start

```bash
corethink login                                     # sign in (approve the code in your browser)
corethink hub list                                  # starter programs that already passed their final check
corethink hub start employee-leave-requests         # copy one into your workspace; prints its environment id
corethink train start <environment> --limit 20      # train it, spending at most $20
corethink train watch <run>                         # follow it live: Data → Mine → Synthesise → Verify → Ship
corethink train show <run>                          # base model vs trained program on held-out tasks
corethink endpoint keys create <environment> --name my-app
corethink endpoint call <environment> "Can Ana take 3 days off next week?"
```

Every command has `--help`, and `corethink --help` lists them all.

## What you can do

| Area | Commands |
| --- | --- |
| Account | `login`, `logout`, `whoami`, `token`, `profile` |
| Workspaces and team | `workspace` (list, use, create, members, invite, roles, audit, credit) |
| Environments | `env` (init, create, check, show, versions, pull, push, archive), `capture` (live traffic → tasks) |
| Connections | `connection` (HTTP/OpenAPI, MCP, databases, your own code; secrets, tests, health) |
| Hub and library | `hub` (starters), `library` (every step training has learned) |
| Training | `train` (start in Automatic or Advanced mode, `--from` an earlier run, test the base model, settings, estimate, list, show, watch, curve, tasks, logs, cancel, resume, archive), `models` |
| Serving | `endpoint` (releases, canaries, keys, usage, call a program, code snippets) |
| Billing | `billing` (balance, usage, buy credit) |
| Archive | `archive` (restore or delete for good) |
| Admins | `admin` (CoreThink staff only) |
| Anything else | `corethink api GET /api/v1/...` calls any Workbench API route |

### Training modes and hyperparameters

`corethink train start ENV` uses **Automatic** mode: recommended settings, and you set the spending limit. For
**Advanced** mode, pass any setting with `--set`, or a JSON file with `--settings`:

```bash
corethink train settings                       # every setting, its default and its allowed range
corethink train start payroll --method search \
  --set search_iterations=8 --set minibatch=30 --capacity spot_then_on_demand --limit 25
```

Values are checked against the same bounds the Workbench enforces before anything is submitted.

## Scripts and CI

Make a token once (`corethink token create github-actions`, or in the Workbench: Settings › CLI sign-ins) and set it
as `CORETHINK_TOKEN`. No login or config file is needed then:

```yaml
- run: pipx install corethink
- run: corethink train start payroll --limit 10 --yes --watch   # fails the step if the run fails
  env:
    CORETHINK_TOKEN: ${{ secrets.CORETHINK_TOKEN }}
```

* `--json` on any command prints machine-readable output to stdout (messages go to stderr).
* `--yes` skips confirmations; without it, a non-interactive run refuses instead of guessing.
* Exit codes: `0` ok, `1` failed, `2` bad usage, `3` not signed in, `4` not allowed, `5` not found, `6` conflict,
  `7` busy or unavailable (try again), `130` interrupted.

## Settings

`corethink login` stores a revocable token in `~/.config/corethink/cli.json` (on Windows `%APPDATA%\CoreThink`),
readable only by you. Revoke any sign-in in the Workbench under Settings › CLI sign-ins, or with `corethink logout`.

| Variable | Meaning |
| --- | --- |
| `CORETHINK_TOKEN` | A CLI token; overrides the stored sign-in |
| `CORETHINK_URL` | Another Workbench (default `https://workbench.corethink.ai`) |
| `CORETHINK_PROFILE` | Which profile to use (`corethink profile list`) |
| `CORETHINK_CONFIG_DIR` | Another config folder |

Shell completion: `corethink --install-completion`.

## Help

Guide: <https://corethink.ai/docs/workbench-cli> · Every command: <https://corethink.ai/docs/workbench-cli-reference> ·
Workbench docs: <https://workbench.corethink.ai/app/docs> · Support: support@corethink.ai
