# CLI

> Manage Tarout from the command line with @tarout/cli

# CLI

The Tarout CLI (`@tarout/cli`) lets you manage applications, databases, domains, and deployments from your terminal.

## Installation

```bash
curl -fsSL https://tarout.sa/install.sh | sh
# or
npm install -g @tarout/cli
```

## Authentication

```bash
# Login to your Tarout account
tarout login

# Check current auth status
tarout whoami

# Logout
tarout logout
```

## Quick Start

```bash
# Navigate to your project
cd my-app

# Inspect this project, prompt for any detected resources, and deploy it: from its
# GitHub repo when it has one (every push then redeploys), otherwise by uploading this folder
tarout deploy --wait

# View deployment logs if you need to reconnect later
tarout deploy:logs <deployment-id> --follow
```

`tarout deploy` prompts for login or account creation when no local session exists. Before creating the app, it inspects the current folder for database, file storage, and Git signals. If it detects Git, you can keep the default current-folder upload flow or choose an already configured Git provider source.

## Configuration

Credentials are **per project**. `tarout login` writes them next to your project,
not to a machine-wide profile, so signing a second project into another account
never re-points the first one.

- **Project credential**: `.tarout/auth.json` - the API token and the account it
  belongs to. Created with mode `0600` inside a `0700` directory, git-ignored
  automatically, and excluded from deploy archives. Resolved by walking **up**
  from the current directory, so it works from any subfolder.
- **Project link**: `.tarout/project.json` - which Tarout application this
  directory deploys to.
- **Machine-wide profile** (opt-in, `tarout login --global`): stored in the OS
  config directory - `~/Library/Preferences/tarout-nodejs/config.json` on macOS,
  `~/.config/tarout-nodejs/config.json` on Linux,
  `%APPDATA%\tarout-nodejs\Config\config.json` on Windows. A project credential
  always wins over it; `--global-auth` ignores the project layer for one command.

## Environment Variables

The CLI respects these environment variables:

| Variable | Description |
|----------|-------------|
| `TAROUT_API_URL` | Override the API host (allow-listed to `tarout.sa`, `*.tarout.sa`, and loopback) |
| `TAROUT_NO_BROWSER` | Never attempt to launch a browser |
| `TAROUT_NO_UPDATE_CHECK` | Skip the automatic self-update check |

## Learn More

- [Commands Reference](https://tarout.sa/docs/cli/commands) - Full list of available commands.
- [API Reference](https://tarout.sa/docs/api) - REST API documentation.

---

## Every Tarout agent guide

- [Start Here (Agents)](https://tarout.sa/docs/for-ai/start.md)
- [Overview](https://tarout.sa/docs/for-ai.md)
- [Deploying an app](https://tarout.sa/docs/for-ai/deploy.md)
- [Databases](https://tarout.sa/docs/for-ai/database.md)
- [Object storage](https://tarout.sa/docs/for-ai/storage.md)
- [Custom domains](https://tarout.sa/docs/for-ai/domains.md)
- [Plans and upgrades](https://tarout.sa/docs/for-ai/billing.md)
- [Troubleshooting](https://tarout.sa/docs/for-ai/troubleshoot.md)
- [Agent Onboarding](https://tarout.sa/docs/for-ai/onboarding.md)
- [CLI Reference](https://tarout.sa/docs/for-ai/cli-reference.md)
- [CLI JSON Schema](https://tarout.sa/docs/for-ai/cli-json-schema.md)

Whole corpus in one file: https://tarout.sa/llms-full.txt · index: https://tarout.sa/llms.txt
Any docs page is raw markdown at the same URL + `.md`. Short link to the entry point: https://tarout.sa/deploy.md
