-
Notifications
You must be signed in to change notification settings - Fork 38
chore: cursor rules #829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
chore: cursor rules #829
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| description: Bootstraps a new CLI command | ||
| globs: | ||
| alwaysApply: false | ||
| --- | ||
|
|
||
| Always prompt for a name if one is not given to you. The name must be lowercased, and use dashes for separators, NOT spaces, NOT underscores. | ||
|
|
||
| Our base class for a command is in [apify-command.ts](mdc:src/lib/command-framework/apify-command.ts), import the `ApifyCommand` class, NOT the `BuiltApifyCommand` class | ||
| Arguments are imported from [args.ts](mdc:src/lib/command-framework/args.ts), by importing the `Args` constant. Always use the variables from there, example: `Args.string()`. | ||
| Flags are imported from [flags.ts](mdc:src/lib/command-framework/flags.ts), by importing the `Flags` constant. Always use the variables from there, example: `Flags.string()`. | ||
|
|
||
| Example class for a command called `wow`: | ||
|
|
||
| ```ts | ||
| export class WowCommand extends ApifyCommand<typeof WowCommand> { | ||
| static override name = "wow" as const; | ||
|
|
||
| async run() { | ||
| // Command logic here | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Look at [validate-schema.ts](mdc:src/commands/validate-schema.ts), [upgrade.ts](mdc:src/commands/cli-management/upgrade.ts) for how to define other properties in a command. Always mark the properties as `static override`. | ||
|
|
||
| Once a command is created, always add it to the end of the `apifyCommands` variable in [\_register.ts](mdc:src/commands/_register.ts). If the user requests an `actor` command instead, update the `actorCommands` variable instead. If unsure, prompt the user for the type. | ||
vladfrangu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.