Metadata-Version: 2.5
Name: djangocloud-cli
Version: 0.1.1
Summary: Deploy a Django app from the command line: djangocloud login, djangocloud deploy, djangocloud logs.
Project-URL: Homepage, https://djangocloud.dev
Project-URL: Source, https://github.com/two-trick-pony-NL/djangocloud-cli
Project-URL: Issues, https://github.com/two-trick-pony-NL/djangocloud-cli/issues
Author-email: Peter van Doorn <peter@petervandoorn.com>
License-Expression: MIT
License-File: LICENSE
Keywords: aws,cli,deploy,django,lightsail
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Framework :: Django :: 5.2
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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
Requires-Python: >=3.10
Requires-Dist: questionary>=2.0
Requires-Dist: rich>=13
Description-Content-Type: text/markdown

# djangocloud-cli

Command-line client for DjangoCloud. Standard library only.

```
pip install djangocloud-cli          # then add "djangocloud_cli" to INSTALLED_APPS
python manage.py djangocloud login
python manage.py djangocloud deploy
python manage.py djangocloud logs -f
python manage.py djangocloud help
```

A standalone `djangocloud` script is installed too (same commands, no `manage.py`), for when your settings won't load.

**Status:** early. `help`, `login`, `logout`, `whoami`, `link`, `unlink` and the interactive setup in `deploy` work
(they need the DjangoCloud API). Uploading, building and deploying, `logs` and `status` are next.

## First run

```
$ python manage.py djangocloud deploy
You're not signed in yet.
Open https://djangocloud.dev/dashboard/cli/?code=ABCD-EFGH and check that the code is ABCD-EFGH.
✓ Signed in as you@example.com
? Which project is this?  (arrow keys)
? Server size  Nano  0.25 vCPU, 0.5 GB RAM  $10/month
? This will cost $10 per month. Continue? Yes
✓ Linked to my-shop (.djangocloud/config.json)
```

`.djangocloud/config.json` says which project this folder deploys to. It holds no secrets and is git-ignored by a
`.gitignore` inside the folder. Later runs skip every prompt.

## CI (GitHub Actions)

Create a token under **Command line → Token for CI** in the dashboard and store it as the repository secret
`DJANGOCLOUD_TOKEN`. `--no-input` makes the CLI fail with a clear message instead of ever prompting or opening a browser.

```yaml
- run: pip install djangocloud-cli
- run: python manage.py djangocloud deploy --no-input --project my-shop
  env:
    DJANGOCLOUD_TOKEN: ${{ secrets.DJANGOCLOUD_TOKEN }}
```

## Configuration

| Variable | Purpose |
|---|---|
| `DJANGOCLOUD_TOKEN` | API token for CI; takes precedence over the stored login |
| `DJANGOCLOUD_NO_INPUT` | Same as `--no-input` (set it to `1`) |
| `DJANGOCLOUD_API` | API base URL (default `https://djangocloud.dev/api/v1`) |

The token from `login` is stored in `~/.config/djangocloud/credentials.json` (mode 600).

## Development

```
uv sync
uv run pytest
uv run ruff check
```
