Skip to content

Commit 9349be5

Browse files
committed
docs: Update and restructure
Refresh and update content from some changes over the past year or so. Streamline the README.md and move richer content to the docs. Add more details on development workflow and setup for folks looking to contribute to CLI development. Reorganize the `docs/` structure to scale better (loosely informed by Diátaxis). We may at some point add another layer of structure depending how large the CLI's feature set becomes. To facilitate some of this cleanup, there are a few supporting changes in the documentation generation tools: - Update awesome-pages-plugin (v2) -> awesome-nav (v3) - Add mkdocs-redirects and add config for existing pages moved with the reorg to not break existing links - Use navigation.sections extension to make the child pages more accessible on the sidebar by turning the top-level directories of `docs/` to sections of the sidebar rather than expandable lists.
1 parent e553caf commit 9349be5

28 files changed

Lines changed: 691 additions & 409 deletions

.github/workflows/ci-nix-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
- uses: ./.github/actions/setup-nix
7272

7373
- name: Run install
74-
run: nix profile install '.'
74+
run: nix profile add '.'
7575

7676
- name: Run --help
7777
run: nava-platform --help

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ __pycache__/
55

66
# generated docs
77
docs/index.md
8-
docs/development/code-reference/
8+
docs/reference/code/
99

1010
# docs site output/build directory
1111
site/

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ This keeps everyone on the same page, avoids wasted efforts on changes that may
4242
not fit the project's direction, and prevents multiple contributors from working
4343
on the same thing.
4444

45+
See [the development docs](./docs/reference/development.md) for details on
46+
technical setup and development workflow.
47+
4548
## Finding where to pitch in
4649

4750
Maintainers label issues that would be good for first-time contributors with

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ docs/index.md: README.md
6161
cp -f $< $@
6262
sed -ri 's|\./docs/||g' $@
6363

64-
REFERENCE_DOC_DIR := ./docs/development/code-reference
64+
REFERENCE_DOC_DIR := ./docs/reference/code
6565

6666
python_module_files := $(shell find nava -type f -name '*.py')
6767
python_module_doc_files := $(patsubst %.py,$(REFERENCE_DOC_DIR)/%.md,$(python_module_files))
@@ -118,6 +118,9 @@ test: ## Run tests
118118
test-e2e: ## Run "e2e" tests, requires that the tool is installed
119119
./bin/test-e2e $(args)
120120

121+
test-watch: ## Run tests continually and watch for changes
122+
$(PY_RUN) pytest-watcher --clear $(PY_SRCS) $(args)
123+
121124
update-container-digest: ## Update container digests to latest
122125
./bin/update-container-digest Dockerfile
123126

README.md

Lines changed: 30 additions & 275 deletions
Original file line numberDiff line numberDiff line change
@@ -16,309 +16,64 @@ _Part of [Nava Strata](https://github.com/navapbc/strata)._
1616

1717
A command-line tool that simplifies installing, upgrading, and managing Nava Strata.
1818

19-
## Quick Start
20-
21-
Try the tool immediately after installation:
22-
23-
```sh
24-
nava-platform infra install ./just-a-test
25-
```
26-
27-
For detailed usage and integration with existing projects, see [the documentation](./docs/getting-started/index.md).
28-
29-
---
30-
3119
## Installation
3220

33-
Choose one of the following installation methods based on your preferences and environment.
34-
35-
### uv
36-
37-
**Recommended for most users.**
38-
39-
**Prerequisites:**
40-
- `git` 2.27+ on your `$PATH`
41-
42-
**Steps:**
43-
44-
1. [Install uv](https://docs.astral.sh/uv/getting-started/installation/) 0.6.15+ (released 2025-04-21)
45-
46-
2. Install the platform CLI:
47-
```sh
48-
uv tool install git+https://github.com/navapbc/platform-cli
49-
```
50-
51-
**One-off execution** (without installing):
52-
```sh
53-
uvx --from git+https://github.com/navapbc/platform-cli -- <platform_cli_args>
54-
```
55-
56-
**Management commands:**
57-
```sh
58-
# Upgrade
59-
uv tool upgrade nava-platform-cli
60-
61-
# Uninstall
62-
uv tool uninstall nava-platform-cli
63-
```
64-
65-
### pipx
66-
67-
**Good alternative if you already have Python installed.**
68-
69-
**Prerequisites:**
70-
- `git` 2.27+ on your `$PATH`
71-
- Python 3.11+ available on your system
72-
73-
**Steps:**
74-
75-
1. [Install pipx](https://pipx.pypa.io/stable/) if you haven't already
76-
77-
2. Install the platform CLI:
78-
```sh
79-
pipx install git+https://github.com/navapbc/platform-cli
80-
```
81-
82-
**Don't have Python 3.11+?** Let pipx fetch it for you:
83-
```sh
84-
pipx install --fetch-missing-python --python 3.12 git+https://github.com/navapbc/platform-cli
85-
```
21+
Recommended options:
8622

87-
**One-off execution** (without installing):
88-
```sh
89-
pipx run --spec git+https://github.com/navapbc/platform-cli nava-platform <platform_cli_args>
90-
```
91-
92-
**Management commands:**
93-
```sh
94-
# Upgrade
95-
pipx upgrade nava-platform-cli
96-
97-
# Uninstall
98-
pipx uninstall nava-platform-cli
99-
```
100-
101-
> **Note:** pipx requires Python 3.10+ to run itself, but installed tools are isolated from system Python packages.
23+
- uv: `uv tool install git+https://github.com/navapbc/platform-cli`
24+
- Nix: `nix profile add github:navapbc/platform-cli`
10225

103-
### Nix
104-
105-
**For users who prefer reproducible builds and declarative environments.**
106-
107-
**Prerequisites:**
108-
- None! Nix provides everything needed.
109-
110-
**Steps:**
111-
112-
1. [Install Nix](https://nixos.org/download/) if you haven't already
113-
114-
2. Install the platform CLI:
115-
```sh
116-
nix profile install github:navapbc/platform-cli
117-
```
118-
119-
**One-off execution** (without installing):
120-
```sh
121-
nix run github:navapbc/platform-cli -- <platform_cli_args>
122-
```
26+
> [!TIP]
27+
>
28+
> The CLI can be installed in additional ways which may fit your needs better.
29+
> See all the supported methods in [the installation
30+
> documentation](./docs/getting-started/installation.md).
12331
124-
**Management commands:**
125-
```sh
126-
# Upgrade
127-
nix profile upgrade platform-cli
32+
## Getting started
12833

129-
# Uninstall
130-
nix profile remove platform-cli
131-
```
132-
133-
**For local development:**
134-
```sh
135-
# From within the cloned repository
136-
nix run . -- <platform_cli_args>
137-
```
138-
139-
> **Note:** First-time execution may take longer due to building dependencies. Subsequent runs will be faster.
140-
141-
### Docker/Container
142-
143-
**For containerized environments or when you want complete isolation.**
144-
145-
**Prerequisites:**
146-
- Docker (or another container runtime)
147-
148-
**Steps:**
149-
150-
1. Clone the repository
151-
152-
2. Build the Docker image:
153-
```sh
154-
make build
155-
```
156-
157-
3. Use the wrapper script for simplified execution:
158-
```sh
159-
./bin/docker-wrapper infra install ./my_project_directory
160-
```
161-
162-
> **Note:** The `docker-wrapper` script makes assumptions about your environment. Review the script comments before use.
163-
164-
**Manual execution:**
165-
166-
After building, run the container directly:
167-
```sh
168-
docker run --rm -it nava-platform-cli
169-
```
170-
171-
**With volume mounting** (required for most operations):
172-
```sh
173-
docker run --rm -it -v "$(pwd):/project-dir" nava-platform-cli infra install /project-dir
174-
```
175-
176-
> **Tip:** Consider creating shell aliases for common invocations.
177-
178-
---
179-
180-
## Getting Started
181-
182-
Once you have `nava-platform` installed, you can start using it immediately.
183-
184-
### Basic Usage
185-
186-
Test the installation with a simple command:
34+
After you have `nava-platform` installed, you can try out a Strata template
35+
install just to see things working:
18736

18837
```sh
18938
nava-platform infra install ./just-a-test
19039
```
19140

192-
### Documentation
41+
Then refer to [the main Getting started documentation][docs-getting-started] for
42+
how to use it with existing projects and more.
19343

194-
For comprehensive guides on using the platform CLI with existing projects:
195-
- [Getting Started Guide](./docs/getting-started/index.md)
196-
- [New Project Setup](./docs/getting-started/new-project.md)
197-
- [Migrating from Legacy Template](./docs/getting-started/migrating-from-legacy-template.md)
44+
[docs-getting-started]: ./docs/getting-started/index.md
19845

199-
### Shell Completion
46+
## Documentation
20047

201-
Enable tab completion for your shell:
48+
In-depth documentation is available at
49+
<https://navapbc.github.io/platform-cli/>.
20250

203-
```sh
204-
nava-platform --install-completion
205-
```
206-
207-
To manually configure completion, get the configuration output:
208-
209-
```sh
210-
nava-platform --show-completion
211-
```
212-
213-
---
51+
When running `nava-platform` itself, use the `--help` flag on commands for more
52+
information.
21453

21554
## Development
21655

217-
Contributing to the platform CLI? Here's how to set up your development environment.
56+
Interested in contributing to the project? See [the development
57+
documentation][docs-development].
21858

219-
### Setup Options
220-
221-
#### Option 1: Nix (Recommended)
222-
223-
1. [Install Nix](https://nixos.org/download/) if you haven't already
224-
2. Activate development shell
225-
226-
```sh
227-
nix develop
228-
```
229-
230-
3. Run Make targets or `uv` as desired
231-
- No need to run `make deps` to get started, all the Python dependencies are
232-
included in the development shell automatically. If you add/remove/update
233-
Python dependencies in `pyproject.toml`, reload the development shell to
234-
pick up the changes.
235-
236-
**Automate environment activation with direnv:**
237-
238-
Basic setup:
239-
240-
```sh
241-
echo "use flake" > .envrc && direnv allow
242-
```
243-
244-
**Recommended:** Use [nix-direnv](https://github.com/nix-community/nix-direnv) for better caching. Add to `.envrc`:
245-
246-
```sh
247-
if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then
248-
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM="
249-
fi
250-
251-
use flake
252-
```
253-
254-
> **Note:** Check the [nix-direnv
255-
> docs](https://github.com/nix-community/nix-direnv?tab=readme-ov-file#installation)
256-
> for the latest version and hash.
257-
258-
#### Option 2: Non-Nix Setup
259-
260-
For basic development and running Python code, this is relatively
261-
straightforward. For a more complete development environment, see the previous
262-
option.
263-
264-
**Prerequisites:**
265-
266-
- GNU Make
267-
268-
**Steps:**
269-
270-
1. [Install uv](https://docs.astral.sh/uv/getting-started/installation/) 0.6.15+ (released 2025-04-21):
271-
272-
```sh
273-
# Or use: make setup-tooling
274-
```
275-
276-
2. Install Python dependencies:
277-
278-
```sh
279-
make deps
280-
```
281-
282-
3. Run the CLI:
283-
284-
```sh
285-
uv run nava-platform
286-
```
287-
288-
### Development Workflow
289-
290-
This is a standard Python project using **uv** for dependency management.
291-
292-
**Useful commands:**
293-
```sh
294-
# See all available commands
295-
make help
296-
297-
# Run quality checks
298-
make check
299-
```
300-
301-
**Best practices:**
302-
- Run `make check` before pushing changes
303-
- Consider setting up a pre-commit hook for automated checks
304-
- See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines
59+
[docs-development]: ./docs/reference/development.md
30560

30661
## Credits
30762

308-
**Icon:** Designed by [OpenMoji](https://openmoji.org/) – the open-source emoji and icon project
309-
License: [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/#)
63+
**Icon:** Designed by [OpenMoji](https://openmoji.org/) – the open-source emoji
64+
and icon project License: [CC BY-SA
65+
4.0](https://creativecommons.org/licenses/by-sa/4.0/#)
31066

31167
**Built with:** [Copier](https://github.com/copier-org/copier) – Template project generator
31268

313-
---
314-
31569
## License
31670

31771
This project is licensed under the Apache 2.0 License. See the
318-
[LICENSE](LICENSE) file for details.
72+
[LICENSE](https://github.com/navapbc/platform-cli/blob/main/LICENSE) file for
73+
details.
31974

32075
## Community
32176

322-
- [Code of Conduct](CODE_OF_CONDUCT.md)
323-
- [Contributing Guidelines](CONTRIBUTING.md)
324-
- [Security Policy](SECURITY.md)
77+
- [Code of Conduct](https://github.com/navapbc/platform-cli/blob/main/CODE_OF_CONDUCT.md)
78+
- [Contributing Guidelines](https://github.com/navapbc/platform-cli/blob/main/CONTRIBUTING.md)
79+
- [Security Policy](https://github.com/navapbc/platform-cli/blob/main/SECURITY.md)

bin/docker-wrapper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
#
33
# Wrap running `nava-platform` via Docker. Pass arguments as you would to
4-
#`nava-platform` itself.
4+
# `nava-platform` itself.
55
#
66
# Since the tool heavily involves manipulating files on the host system, some of
77
# which are in locations that may need created first, it can be fiddly to

0 commit comments

Comments
 (0)