Note
this fork exists because the upstream repo went stale and stopped reliably merging update PRs.
it auto-bumps CLIProxyAPI editions, refreshes hashes, and commits those changes directly to main
so the flake keeps tracking upstream releases without human babysitting.
Nix flake for CLIProxyAPI editions - AI CLI proxy services providing OpenAI/Gemini/Claude compatible APIs.
Available editions: CLIProxyAPI (base) and CLIProxyAPIBusiness (enterprise features).
Warning
CLIProxyAPIPlus is temporarily not distributed because its upstream repository and release assets are not publicly fetchable.
- Package for Linux (x86_64, aarch64) and macOS (Intel, Apple Silicon)
- NixOS module with systemd service
- nix-darwin module with launchd service
- Optional storage backends: Git, PostgreSQL, S3
- Automatic version updates via GitHub Actions
| Package | Description | License | Default Port |
|---|---|---|---|
cliproxyapi |
Base AI CLI proxy (OpenAI/Gemini/Claude compatible) | MIT | 8317 |
cliproxyapi-business |
Full business edition (user mgmt, billing, web UI, DB support) | SSPL | 8318 |
All editions install their binary as cliproxyapi, making them interchangeable in NixOS/darwin modules.
# Run base edition
nix run github:GustavoWidman/nix-cliproxyapi
# Run business edition
nix run github:GustavoWidman/nix-cliproxyapi#cliproxyapi-business{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
cliproxyapi.url = "github:GustavoWidman/nix-cliproxyapi";
};
outputs = { self, nixpkgs, cliproxyapi }: {
# Your configuration here
};
}{ inputs, ... }:
{
imports = [ inputs.cliproxyapi.nixosModules.default ];
services.cliproxyapi = {
enable = true;
openFirewall = true; # Optional: open port 8317
};
}This will:
- Create a
cliproxyapiuser and group - Create
/var/lib/cliproxyapifor data storage - Copy
config.example.yamlto the data directory on first run - Start the service on port 8317
To use a different edition, override the package:
{ inputs, pkgs, ... }:
{
imports = [ inputs.cliproxyapi.nixosModules.default ];
services.cliproxyapi = {
enable = true;
package = inputs.cliproxyapi.packages.${pkgs.system}.cliproxyapi-business;
port = 8318; # Business edition default port
openFirewall = true;
};
}{
services.cliproxyapi = {
enable = true;
configFile = /path/to/your/config.yaml;
};
}Sync configuration and auth tokens with a Git repository:
{
services.cliproxyapi = {
enable = true;
managementPasswordFile = "/run/secrets/cliproxyapi-management-password";
storage = {
type = "git";
git = {
url = "https://github.com/youruser/cliproxyapi-config.git";
username = "youruser";
tokenFile = "/run/secrets/github-token";
};
};
};
}Store configuration in PostgreSQL:
{
services.cliproxyapi = {
enable = true;
managementPasswordFile = "/run/secrets/cliproxyapi-management-password";
storage = {
type = "postgres";
postgres = {
dsnFile = "/run/secrets/postgres-dsn"; # Contains: postgresql://user:pass@host:5432/db
schema = "cliproxyapi";
};
};
};
}Store configuration in S3-compatible object storage:
{
services.cliproxyapi = {
enable = true;
managementPasswordFile = "/run/secrets/cliproxyapi-management-password";
storage = {
type = "s3";
s3 = {
endpoint = "https://s3.amazonaws.com";
bucket = "my-cliproxyapi-config";
accessKeyFile = "/run/secrets/s3-access-key";
secretKeyFile = "/run/secrets/s3-secret-key";
};
};
};
}{ inputs, ... }:
{
imports = [ inputs.cliproxyapi.darwinModules.default ];
services.cliproxyapi = {
enable = true;
};
}The darwin module supports the same storage options as the NixOS module.
This flake intentionally does not manage config.yaml because:
- CLIProxyAPI configuration is complex and highly variable
- The Web UI provides an excellent configuration experience
- The Desktop GUI (EasyCLI) offers another way to configure
- Remote storage backends (Git, PostgreSQL, S3) allow configuration management outside of Nix
After starting the service, you can:
- Access the Web UI at
http://localhost:8317 - Edit
/var/lib/cliproxyapi/config.yamldirectly - Use remote storage to manage configuration
See the CLIProxyAPI documentation for configuration details.
| Option | Type | Default | Description |
|---|---|---|---|
enable |
bool | false | Enable the CLIProxyAPI service |
package |
package | (from flake) | The CLIProxyAPI package to use |
port |
port | 8317 | Port for CLIProxyAPI to listen on |
dataDir |
path | /var/lib/cliproxyapi | Directory for data storage |
configFile |
path or null | null | Path to config.yaml (optional) |
storage.type |
enum | "local" | Storage backend: local, git, postgres, s3 |
managementPasswordFile |
path or null | null | File with management UI password |
extraEnvironment |
attrs | {} | Extra environment variables |
| Option | Type | Default | Description |
|---|---|---|---|
openFirewall |
bool | false | Open firewall for CLIProxyAPI port |
user |
string | "cliproxyapi" | User account for the service |
group |
string | "cliproxyapi" | Group for the service |
You can also use the packages via the overlay:
{
nixpkgs.overlays = [ inputs.cliproxyapi.overlays.default ];
# All three packages are available:
environment.systemPackages = [
pkgs.cliproxyapi # Base edition
# pkgs.cliproxyapi-plus # Plus edition
# pkgs.cliproxyapi-business # Business edition
];
}This repository includes a GitHub Action that checks for new CLIProxyAPI releases daily and commits updated versions and hashes directly to main.
The workflow checks each edition independently and applies all needed updates in one commit, so stale maintainer review doesn't block releases.
To manually trigger an update:
- Go to Actions -> "Update CLIProxyAPI Version"
- Select the edition from the dropdown
- Optionally specify a version, or leave empty for latest
The packaging code in this repository is licensed under MIT - see LICENSE.
Upstream licenses vary by edition:
- CLIProxyAPI and CLIProxyAPIPlus: MIT License
- CLIProxyAPIBusiness: SSPL-1.0 (Server Side Public License)