Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 1.75 KB

File metadata and controls

33 lines (21 loc) · 1.75 KB

CLAUDE.md

Guidance for Claude Code working in this repository. Humans should read README.md and CONTRIBUTING.md first.

Entry points

  • apify CLI — src/entrypoints/apify.ts
  • actor CLI — src/entrypoints/actor.ts

Before you push

Run yarn lint && yarn format && yarn build && yarn test:local before pushing. Run yarn test:api too if you changed anything that touches the Apify API.

If you modified a command's flags, args, description, or added/removed a command, also run yarn update-docs and commit the regenerated docs/ output.

Code conventions

  • Package manager: Yarn 4 (via Corepack). Do not use npm.
  • Use .js import specifiers for local files (e.g. import { foo } from './foo.js'). The .ts source resolves at build time.
  • Commands extend ApifyCommand from src/lib/command-framework/apify-command.ts. Follow the pattern of existing commands: static override name, static override description, static override flags/args, and an async run() method.
  • New commands must be registered in src/commands/_register.ts (or the parent _index.ts for subcommands).
  • Do not add docstrings, comments, or type annotations to code you did not change. Keep diffs tight.

Testing

  • Tests use Vitest. See CONTRIBUTING.md for useAuthSetup and useTempPath hook usage.
  • API tests must include [api] in the test name and live in test/api/.
  • Always import process from 'node:process' in command/lib code — never use globalThis.process. This is required for test cwd mocks to work.

Things to avoid

  • Do not use --no-verify to skip git hooks. Fix the underlying issue.
  • Do not edit docs/ by hand — it is generated by yarn update-docs.