{"id":50390939,"url":"https://github.com/mathieubuisson/icu-cli","last_synced_at":"2026-05-30T18:01:28.810Z","repository":{"id":357231727,"uuid":"1234944849","full_name":"MathieuBuisson/icu-cli","owner":"MathieuBuisson","description":"Command-line tool for interacting with intervals.icu","archived":false,"fork":false,"pushed_at":"2026-05-11T22:07:02.000Z","size":97,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-11T23:38:54.570Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MathieuBuisson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-10T20:57:34.000Z","updated_at":"2026-05-11T22:07:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/MathieuBuisson/icu-cli","commit_stats":null,"previous_names":["mathieubuisson/icu-cli"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/MathieuBuisson/icu-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuBuisson%2Ficu-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuBuisson%2Ficu-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuBuisson%2Ficu-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuBuisson%2Ficu-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MathieuBuisson","download_url":"https://codeload.github.com/MathieuBuisson/icu-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuBuisson%2Ficu-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33703065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-05-30T18:01:27.841Z","updated_at":"2026-05-30T18:01:28.788Z","avatar_url":"https://github.com/MathieuBuisson.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# icu-cli\n\nA cross-platform TypeScript CLI for the [Intervals.icu](https://intervals.icu) API.\nQuery, schedule, and automate training data from the command line.\n\n## Features\n\n- **11 API service groups** — athletes, activities, events, wellness, workouts, sport settings, chats, weather, shared events, fitness, and performance curves\n- **Cross-platform** — runs on Windows x64, Linux x64, and macOS arm64\n- **Multiple output formats** — TTY-aware defaults with `--format json|table|plain`\n- **Dual auth support** — API key (Basic auth) and OAuth bearer token\n- **Type-safe API client** — auto-generated from the Intervals.icu OpenAPI spec\n- **Flexible input** — read JSON from files (`--file path`) or stdin (`--file -`)\n- **Zero-dependency distribution** — available as a standalone single executable (no Node.js required)\n\n## Technology Stack\n\n| Component | Choice |\n|---|---|\n| Language | TypeScript 5.x (strict) |\n| Runtime | Node.js 24 LTS |\n| CLI framework | [commander](https://github.com/tj/commander.js) |\n| API client | [openapi-typescript](https://github.com/openapi-ts/openapi-typescript) + [openapi-fetch](https://github.com/openapi-ts/openapi-typescript/tree/main/packages/openapi-fetch) |\n| Table output | [cli-table3](https://github.com/cli-table/cli-table3) |\n| Bundler | [tsup](https://github.com/egoist/tsup) |\n| Single executable | [Bun](https://bun.sh) `build --compile` |\n| Testing | [vitest](https://vitest.dev) |\n| Lint + Format | [Biome](https://biomejs.dev) |\n| Validation | [Zod](https://zod.dev) |\n\n## Installation\n\n### Prerequisites\n\n- [Node.js](https://nodejs.org) 24 LTS or later\n- An [Intervals.icu](https://intervals.icu) account with an API key (Settings → Developer Settings)\n\n### Setup\n\n**Via npm:**\n\n```bash\nnpm install -g icu-cli\n```\n\n**Via standalone binary:**\n\nDownload the latest release for your platform from [GitHub Releases](https://github.com/MathieuBuisson/icu-cli/releases):\n- `icu-win-x64.exe` — Windows\n- `icu-linux-x64` — Linux\n- `icu-macos-arm64` — macOS (Apple Silicon)\n\nNo Node.js installation required for standalone binaries.\n\n**Configure authentication:**\n\n```bash\n# Set your API key (from Intervals.icu → Settings → Developer Settings)\nexport ICU_API_KEY=your_api_key_here\n\n# Or use an OAuth bearer token (takes precedence if both are set)\nexport ICU_ACCESS_TOKEN=your_token_here\n```\n\n**Configure your athlete ID:**\n\n```bash\nicu config set athleteId i12345\n```\n\n**Verify setup:**\n\n```bash\nicu whoami\n```\n\n## Usage\n\n```\nicu [options] \u003ccommand\u003e [subcommand] [args]\n\nOptions:\n  --athlete \u003cid\u003e    Override athlete ID\n  --format \u003cfmt\u003e    Output format: json, table, plain\n  --version         Show version\n  --help            Show help\n```\n\n### Examples\n\n```bash\n# Show authenticated athlete info\nicu whoami\n\n# List recent activities\nicu activities list --oldest 2026-01-01 --newest 2026-01-31\n\n# Search activities by name or tag\nicu activities search --query \"#threshold\"\n\n# Get a specific activity\nicu activities get i12345:abc123\n\n# Upload an activity file\nicu activities upload activity.fit\n\n# List upcoming events\nicu events list --oldest 2026-05-01 --newest 2026-05-31\n\n# Create an event from a JSON file\nicu events create --file event.json\n\n# Create an event from stdin\necho '{\"category\":\"NOTE\",\"start_date_local\":\"2026-05-15\",\"name\":\"Rest day\"}' | icu events create --file -\n\n# Download a workout in Zwift format\nicu workouts download 123 --ext zwo --output workout.zwo\n\n# Get today's wellness record\nicu wellness get 2026-05-10\n\n# Update wellness from JSON\necho '{\"restingHR\":48,\"weight\":78.2}' | icu wellness update 2026-05-10 --file -\n\n# Get weather forecast\nicu weather forecast\n\n# View power curves for the past year\nicu performance power --type Ride --curves 1y\n\n# Force JSON output (useful for scripting)\nicu activities list --oldest 2026-01-01 --format json\n```\n\n## Project Structure\n\n```text\nicu-cli/\n├── src/\n│   ├── index.ts                  # Entry point\n│   ├── cli.ts                    # Commander program setup\n│   ├── config.ts                 # Config file read/write\n│   ├── auth.ts                   # Auth header resolution\n│   ├── client.ts                 # openapi-fetch client factory\n│   ├── output.ts                 # TTY-aware output formatting\n│   ├── input.ts                  # --file / stdin input reader\n│   ├── utils/\n│   │   └── validation.ts          # Zod runtime validation\n│   ├── commands/                 # One module per command group\n│   │   ├── whoami.ts\n│   │   ├── config-cmd.ts\n│   │   ├── auth-cmd.ts\n│   │   ├── athletes.ts\n│   │   ├── activities.ts\n│   │   ├── events.ts\n│   │   ├── wellness.ts\n│   │   ├── workouts.ts\n│   │   ├── sport-settings.ts\n│   │   ├── chats.ts\n│   │   ├── weather.ts\n│   │   ├── shared-events.ts\n│   │   ├── fitness.ts\n│   │   └── performance.ts\n│   └── generated/\n│       └── api.d.ts              # Auto-generated OpenAPI types\n├── tests/\n│   ├── unit/                     # Unit tests for core modules\n│   └── integration/              # Command integration tests\n├── api/\n│   └── openapi-spec.json         # Pinned Intervals.icu OpenAPI spec\n├── package.json\n├── tsconfig.json\n├── biome.json\n├── SPEC.md                       # Technical specification\n├── AGENTS.md                     # AI agent onboarding\n└── README.md\n```\n\n## Testing\n\n```bash\n# Run all tests\nnpm test\n\n# Run tests in watch mode\nnpm run test:watch\n```\n\nTests use [vitest](https://vitest.dev) with mocked HTTP responses for API interactions.\n\n## Code Quality\n\n```bash\n# Lint and format check\nnpm run lint\n\n# Lint and format with auto-fix\nnpm run lint:fix\n\n# Format only\nnpm run format\n```\n\nLinting and formatting are handled by [Biome](https://biomejs.dev).\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieubuisson%2Ficu-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathieubuisson%2Ficu-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieubuisson%2Ficu-cli/lists"}