{"id":20611973,"url":"https://github.com/tcarrio/oauth-token-cli","last_synced_at":"2026-04-26T20:32:05.051Z","repository":{"id":251431936,"uuid":"837400429","full_name":"tcarrio/oauth-token-cli","owner":"tcarrio","description":"A Bun CLI utility for automating OAuth flows","archived":false,"fork":false,"pushed_at":"2025-09-27T04:22:20.000Z","size":106,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-27T05:40:51.455Z","etag":null,"topics":["bun","cli","oauth","oidc"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tcarrio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-02T22:19:09.000Z","updated_at":"2025-09-27T04:22:24.000Z","dependencies_parsed_at":"2024-11-16T10:26:59.393Z","dependency_job_id":null,"html_url":"https://github.com/tcarrio/oauth-token-cli","commit_stats":null,"previous_names":["tcarrio/oauth-device-code-cli","tcarrio/oauth-token-cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tcarrio/oauth-token-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcarrio%2Foauth-token-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcarrio%2Foauth-token-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcarrio%2Foauth-token-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcarrio%2Foauth-token-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tcarrio","download_url":"https://codeload.github.com/tcarrio/oauth-token-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcarrio%2Foauth-token-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32312252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T19:15:34.056Z","status":"ssl_error","status_checked_at":"2026-04-26T19:15:15.467Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","cli","oauth","oidc"],"created_at":"2024-11-16T10:22:47.360Z","updated_at":"2026-04-26T20:32:05.042Z","avatar_url":"https://github.com/tcarrio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OAuth Token CLI\n\n[![built with nix](https://img.shields.io/static/v1?logo=nixos\u0026logoColor=white\u0026label=\u0026message=Built%20with%20Nix\u0026color=41439a)](https://builtwithnix.org)\n[![CI](https://github.com/tcarrio/oauth-token-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/tcarrio/oauth-token-cli/actions/workflows/ci.yml)\n[![FlakeHub](https://img.shields.io/endpoint?url=https://flakehub.com/f/tcarrio/oauth-token-cli/badge)](https://flakehub.com/f/tcarrio/oauth-token-cli)\n[![License](https://img.shields.io/github/license/tcarrio/oauth-token-cli)](LICENSE)\n[![Nix Flake](https://img.shields.io/badge/nix-flake-blue?logo=nixos)](https://nixos.org)\n[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?logo=typescript\u0026logoColor=white)](https://www.typescriptlang.org/)\n[![Bun](https://img.shields.io/badge/Bun-000000?logo=bun\u0026logoColor=white)](https://bun.sh)\n\nA modern OAuth/OIDC CLI tool for obtaining access tokens from OAuth providers. Built with Nix for reproducible development and deployment.\n\n## 🎯 Features\n\n- **Multiple OAuth flows**: Authorization Code with PKCE, Device Code Flow, Client Credentials\n- **Flexible output**: Console output or direct clipboard integration\n- **Configuration support**: JSON config files, environment variables, and CLI arguments\n- **Cross-platform**: Works on macOS, Linux, and Windows\n- **Compiled binary**: Single executable with no runtime dependencies\n\n## 🚀 Quick Start\n\n### Prerequisites\n\nThis is a **Nix-first project**. You'll need:\n\n- **[Nix](https://nixos.org/download.html)** - Package manager and build system\n- **[direnv](https://direnv.net/)** *(recommended)* - Automatic environment management\n\n### Option 1: Run directly (no installation)\n\n```bash\n# Run the latest version from FlakeHub\nnix run github:tcarrio/oauth-token-cli -- --help\n```\n\n### Option 2: Install and use\n\n```bash\n# Install the CLI\nnix profile install github:tcarrio/oauth-token-cli\n\n# Use it\noauth-token-cli --help\n```\n\n### Option 3: Build from source\n\n```bash\n# Clone the repository\ngit clone https://github.com/tcarrio/oauth-token-cli.git\ncd oauth-token-cli\n\n# If you have direnv installed, the development environment will activate automatically\n# Otherwise, enter the development shell manually:\nnix develop\n\n# Build the binary\nnix build\n\n# Run the compiled binary\n./result/bin/oauth-token-cli --help\n```\n\n## 🛠️ Development\n\nThis project uses a modern Nix-based development workflow with comprehensive tooling:\n\n### Development Environment\n\n```bash\n# Enter the development shell (or use direnv for automatic activation)\nnix develop\n\n# The shell provides:\n# - Bun runtime and package manager\n# - All formatting and linting tools\n# - Pre-commit hooks\n# - CI/CD commands\n```\n\n### Available Commands\n\n#### Formatting \u0026 Linting\n```bash\n# Format all files (TypeScript, Nix, YAML, JSON)\ntreefmt\n\n# Check formatting without changes\ntreefmt --fail-on-change\n\n# Run TypeScript/JavaScript linting\nbun run lint\n\n# Auto-fix linting issues\nbun run lint:fix\n```\n\n#### CI/CD Commands\n```bash\n# Run comprehensive CI checks (same as GitHub Actions)\nnix run .#ci-check\n\n# Individual CI commands\nnix run .#ci-install     # Check dependencies\nnix run .#ci-format      # Check formatting\nnix run .#ci-lint        # Run linting\nnix run .#ci-build       # Test build\nnix run .#ci-test        # Test functionality\n```\n\n#### Development Workflow\n```bash\n# Install pre-commit hooks (done automatically in dev shell)\npre-commit install\n\n# Run pre-commit hooks manually\npre-commit run --all-files\n\n# All commits automatically:\n# 1. Format all files\n# 2. Fix linting issues\n# 3. Stage changes\n# 4. Validate everything passes\n# 5. Block commit if unfixable errors remain\n```\n\n### Tools \u0026 Technologies\n\n- **🏗️ Build System**: Nix flakes with bun2nix for dependency management\n- **📝 Language**: TypeScript with strict typing and Bun runtime\n- **🎨 Formatting**: \n  - [Biome](https://biomejs.dev/) for TypeScript/JavaScript/JSON\n  - [yamlfmt](https://github.com/google/yamlfmt) for YAML files\n  - [Alejandra](https://github.com/kamadorueda/alejandra) for Nix files\n- **🔍 Linting**: \n  - [Biome](https://biomejs.dev/) for TypeScript/JavaScript\n  - [deadnix](https://github.com/astro/deadnix) for dead Nix code detection\n  - [statix](https://github.com/nerdypepper/statix) for Nix static analysis\n- **🔗 Git Hooks**: Pre-commit hooks with automatic formatting and validation\n- **📦 Dependencies**: Schema validation with [Zod](https://zod.dev/)\n- **🌐 HTTP**: [Ky](https://github.com/sindresorhus/ky) for HTTP requests\n- **📋 Clipboard**: [clipboardy](https://github.com/sindresorhus/clipboardy) for clipboard integration\n\n## 📖 Usage\n\n### Basic Usage\n\n```bash\n# Get help\noauth-token-cli --help\n\n# Authorization Code Flow with PKCE\noauth-token-cli \\\n  --flow authorization-code \\\n  --client-id \"your-client-id\" \\\n  --base-url \"https://your-oauth-provider.com\" \\\n  --audience \"https://your-api.com\" \\\n  --scopes \"read write\" \\\n  --copy  # Copy token to clipboard\n\n# Device Code Flow\noauth-token-cli \\\n  --flow device-code \\\n  --client-id \"your-client-id\" \\\n  --base-url \"https://your-oauth-provider.com\" \\\n  --audience \"https://your-api.com\" \\\n  --scopes \"read write\"\n\n# Client Credentials Flow\noauth-token-cli \\\n  --flow client-credentials \\\n  --client-id \"your-client-id\" \\\n  --client-secret \"your-client-secret\" \\\n  --base-url \"https://your-oauth-provider.com\" \\\n  --audience \"https://your-api.com\"\n```\n\n### Configuration\n\nYou can use a configuration file to set default values:\n\n```json\n{\n  \"oauth\": {\n    \"clientId\": \"your-default-client-id\",\n    \"baseUrl\": \"https://your-oauth-provider.com\",\n    \"audience\": \"https://your-api.com\",\n    \"scopes\": \"read write\",\n    \"flow\": \"device-code\"\n  },\n  \"logLevel\": \"Info\",\n  \"output\": {\n    \"target\": \"clipboard\"\n  }\n}\n```\n\nPlace this file at:\n- `~/.config/oauth-device-code-cli/config.json` (Linux/macOS)\n- `$XDG_CONFIG_HOME/oauth-device-code-cli/config.json` (if XDG_CONFIG_HOME is set)\n\n### Environment Variables\n\nAll CLI options can be set via environment variables:\n\n```bash\nexport OAUTH_CLIENT_ID=\"your-client-id\"\nexport OAUTH_BASE_URL=\"https://your-oauth-provider.com\"\nexport OAUTH_AUDIENCE=\"https://your-api.com\"\nexport OAUTH_SCOPES=\"read write\"\nexport OAUTH_FLOW=\"device-code\"\nexport LOG_LEVEL=\"Info\"\nexport OUTPUT_TARGET=\"clipboard\"\n\noauth-token-cli\n```\n\n## 🚦 GitHub Actions\n\nThe project includes comprehensive CI/CD workflows:\n\n- **🔄 CI Pipeline**: Runs formatting, linting, building, and testing on every push/PR\n- **❄️ Flake Lock Updates**: Automatically updates Nix dependencies twice weekly\n- **📦 FlakeHub Publishing**: Publishes releases to FlakeHub for easy consumption\n- **🔍 Security**: All checks must pass before merging\n- **⚡ Performance**: Nix caching eliminates redundant builds\n\n## 🤝 Contributing\n\n1. **Fork the repository**\n2. **Create a feature branch**: `git checkout -b feature/amazing-feature`\n3. **Make your changes** (pre-commit hooks will format and validate automatically)\n4. **Push to the branch**: `git push origin feature/amazing-feature`\n5. **Open a Pull Request**\n\nAll contributions are automatically checked for:\n- Code formatting consistency\n- Linting compliance\n- Build success\n- Test passing\n- Nix flake validity\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- Built with [Nix](https://nixos.org/) for reproducible builds\n- Powered by [Bun](https://bun.sh) for fast TypeScript execution\n- Formatted with [Biome](https://biomejs.dev/) for consistent code style\n- Inspired by modern OAuth best practices\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcarrio%2Foauth-token-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftcarrio%2Foauth-token-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcarrio%2Foauth-token-cli/lists"}