|
| 1 | +# Installation |
| 2 | + |
| 3 | +This guide covers all methods to install Probitas CLI. |
| 4 | + |
| 5 | +## Requirements |
| 6 | + |
| 7 | +- [Deno](https://deno.land/) v2.x or later |
| 8 | + |
| 9 | +## Shell Installer |
| 10 | + |
| 11 | +Install the CLI using the shell installer: |
| 12 | + |
| 13 | +```bash |
| 14 | +curl -fsSL https://raw.githubusercontent.com/jsr-probitas/cli/main/install.sh | bash |
| 15 | +``` |
| 16 | + |
| 17 | +### Options |
| 18 | + |
| 19 | +Configure installation via environment variables: |
| 20 | + |
| 21 | +```bash |
| 22 | +# Install specific version |
| 23 | +curl -fsSL https://raw.githubusercontent.com/jsr-probitas/cli/main/install.sh | PROBITAS_VERSION=0.7.3 bash |
| 24 | + |
| 25 | +# Install to custom directory |
| 26 | +curl -fsSL https://raw.githubusercontent.com/jsr-probitas/cli/main/install.sh | PROBITAS_INSTALL_DIR=/usr/local/bin bash |
| 27 | +``` |
| 28 | + |
| 29 | +## Homebrew (macOS/Linux) |
| 30 | + |
| 31 | +Install via the official Homebrew tap: |
| 32 | + |
| 33 | +```bash |
| 34 | +# Add the tap and install |
| 35 | +brew tap jsr-probitas/tap |
| 36 | +brew install probitas |
| 37 | + |
| 38 | +# Or install directly |
| 39 | +brew install jsr-probitas/tap/probitas |
| 40 | +``` |
| 41 | + |
| 42 | +Deno is installed automatically as a dependency. |
| 43 | + |
| 44 | +## Nix |
| 45 | + |
| 46 | +The Probitas CLI provides a Nix flake with multiple usage patterns. |
| 47 | + |
| 48 | +### Run Without Installing |
| 49 | + |
| 50 | +Execute `probitas` directly without installing: |
| 51 | + |
| 52 | +```bash |
| 53 | +nix run github:jsr-probitas/cli |
| 54 | +``` |
| 55 | + |
| 56 | +### Install to Profile |
| 57 | + |
| 58 | +Install into your Nix profile for persistent access: |
| 59 | + |
| 60 | +```bash |
| 61 | +nix profile install github:jsr-probitas/cli |
| 62 | +``` |
| 63 | + |
| 64 | +### Add to Project's flake.nix |
| 65 | + |
| 66 | +Add Probitas to your project's development environment. Create or update |
| 67 | +`flake.nix`: |
| 68 | + |
| 69 | +```nix |
| 70 | +{ |
| 71 | + inputs = { |
| 72 | + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; |
| 73 | + flake-utils.url = "github:numtide/flake-utils"; |
| 74 | + probitas.url = "github:jsr-probitas/cli"; |
| 75 | + probitas.inputs.nixpkgs.follows = "nixpkgs"; |
| 76 | + probitas.inputs.flake-utils.follows = "flake-utils"; |
| 77 | + }; |
| 78 | +
|
| 79 | + outputs = { self, nixpkgs, flake-utils, probitas }: |
| 80 | + flake-utils.lib.eachDefaultSystem (system: |
| 81 | + let |
| 82 | + pkgs = import nixpkgs { inherit system; }; |
| 83 | + in { |
| 84 | + devShells.default = pkgs.mkShell { |
| 85 | + packages = [ |
| 86 | + pkgs.deno |
| 87 | + probitas.packages.${system}.default |
| 88 | + ]; |
| 89 | + }; |
| 90 | + }); |
| 91 | +} |
| 92 | +``` |
| 93 | + |
| 94 | +Enter the development environment: |
| 95 | + |
| 96 | +```bash |
| 97 | +nix develop |
| 98 | +``` |
| 99 | + |
| 100 | +### Why Use inputs.follows? |
| 101 | + |
| 102 | +The `inputs.follows` directive ensures Probitas uses your project's nixpkgs |
| 103 | +version instead of its own pinned version: |
| 104 | + |
| 105 | +```nix |
| 106 | +probitas.inputs.nixpkgs.follows = "nixpkgs"; |
| 107 | +probitas.inputs.flake-utils.follows = "flake-utils"; |
| 108 | +``` |
| 109 | + |
| 110 | +Benefits: |
| 111 | + |
| 112 | +- **Single nixpkgs version**: All dependencies share one nixpkgs, reducing |
| 113 | + closure size |
| 114 | +- **Consistent tooling**: Deno version matches across your project |
| 115 | +- **Faster evaluation**: Fewer inputs to fetch and evaluate |
| 116 | + |
| 117 | +### Pin a Specific Version |
| 118 | + |
| 119 | +Lock to a specific CLI version using a commit hash or tag: |
| 120 | + |
| 121 | +```nix |
| 122 | +probitas.url = "github:jsr-probitas/cli/v0.7.3"; |
| 123 | +``` |
| 124 | + |
| 125 | +Or using a commit: |
| 126 | + |
| 127 | +```nix |
| 128 | +probitas.url = "github:jsr-probitas/cli/abc1234"; |
| 129 | +``` |
| 130 | + |
| 131 | +### Flake Outputs Reference |
| 132 | + |
| 133 | +The Probitas CLI flake provides: |
| 134 | + |
| 135 | +| Output | Description | |
| 136 | +| ----------------------------- | --------------------------- | |
| 137 | +| `packages.${system}.default` | The `probitas` CLI package | |
| 138 | +| `packages.${system}.probitas` | Alias for the CLI package | |
| 139 | +| `apps.${system}.default` | App for `nix run` | |
| 140 | +| `devShells.${system}.default` | Development shell with Deno | |
| 141 | + |
| 142 | +## Verify Installation |
| 143 | + |
| 144 | +After installation, verify the CLI is working: |
| 145 | + |
| 146 | +```bash |
| 147 | +probitas --version |
| 148 | +``` |
| 149 | + |
| 150 | +## Next Steps |
| 151 | + |
| 152 | +- [Quick Start](/docs/overview/#quick-start) - Initialize your first project |
| 153 | +- [Scenario Guide](/docs/scenario/) - Learn to write scenarios |
0 commit comments