Skip to content

Latest commit

 

History

History
46 lines (38 loc) · 2.49 KB

File metadata and controls

46 lines (38 loc) · 2.49 KB

Repository Guidelines

Project Structure & Module Organization

  • src/ contains the TypeScript source. Entry points are src/index.ts (CLI) and src/client.ts (SDK-style exports).
  • src/commands/ holds individual CLI command implementations.
  • src/utils/ provides shared helpers.
  • tests/ includes Bun tests (e.g., tests/cli.test.ts).
  • dist/ is the build output (dist/index.js), generated by bun run build.

Build, Test, and Development Commands

  • bun run dev: run the CLI in watch mode for local development.
  • bun run start: execute src/index.ts without watching.
  • bun test: run the Bun test suite.
  • bun run lint: lint src/ and tests/ with Biome.
  • bun run format: auto-format code with Biome.
  • bun run typecheck: run tsc --noEmit.
  • bun run build: bundle the CLI to dist/ and make it executable.
  • bun run release:patch|minor|major: bump version, run lint/tests/build, tag, and push.

Tooling Preferences

  • Use Bun for local tooling (bun run, bun test, bun run build) instead of npm/yarn.
  • Prefer Node.js built-in modules (node:fs, node:path, etc.) over Bun-specific runtime APIs unless there is a clear need.

Key Patterns

  • Keep AGENTS.md updated whenever code changes affect tooling, runtime APIs, workflows, or conventions.
  • Always run lint and tests to verify code changes.
  • Use Conventional Commits style for git commit messages (e.g., feat:, fix:, chore:).

Coding Style & Naming Conventions

  • Use 2-space indentation, double quotes, and a 120-character line width (Biome).
  • Keep file and test names in kebab-case or camelCase as already used (e.g., client.ts, cli.test.ts).
  • Prefer TypeScript types over any; follow existing module boundaries in src/commands/ and src/utils/.

Testing Guidelines

  • Framework: Bun’s built-in test runner (bun test).
  • Tests live in tests/ and follow *.test.ts naming.
  • Add or update tests for new commands or client behavior; keep unit tests fast and isolated from real Intercom API calls.

Commit & Pull Request Guidelines

  • Commit messages follow a lightweight Conventional Commit style (e.g., feat(commands): add ticket close).
  • PRs should include a clear description, any relevant screenshots or CLI output, and the commands you ran (e.g., bun test).
  • Link related issues when applicable.

Configuration & Security

  • Use INTERCOM_ACCESS_TOKEN or ~/.config/intercom-cli/config.json for auth; never commit real tokens.
  • Avoid logging sensitive data in tests or CLI examples.