-
-
Notifications
You must be signed in to change notification settings - Fork 70
docs: Restructure docs around AI tools/cli to make them more discoverable #2589
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
Open
reczkok
wants to merge
2
commits into
impr/non-interactive-cli
Choose a base branch
from
docs/more-discoverable-skills
base: impr/non-interactive-cli
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
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
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,26 @@ | ||
| --- | ||
| title: AI Tools | ||
| description: A guide to using TypeGPU resources with AI coding agents. | ||
| --- | ||
|
|
||
| TypeGPU provides optional tools for AI coding agents working with TypeGPU projects. | ||
| They help agents find TypeGPU-specific guidance and inspect generated shader code while debugging. | ||
|
|
||
| ## TypeGPU Skill | ||
|
|
||
| The official TypeGPU Skill gives agents guidance for TypeGPU schemas, functions, shaders, buffers, textures, pipelines, and common error patterns. | ||
|
|
||
| To install it, use the [Software Mansion Skills repository](https://github.com/software-mansion-labs/skills) and select the TypeGPU skill during the setup process. | ||
|
|
||
| :::tip | ||
| The TypeGPU project starter can install the skill for you. Run `npx typegpu@latest` and enable AI skills when prompted. | ||
| For a non-interactive setup, run `npx typegpu@latest my-app --yes --agent-skills`. | ||
| For an existing project, run `npx typegpu@latest --enhance --yes --agent-skills`. | ||
| ::: | ||
|
|
||
| ## TypeGPU MCP | ||
|
|
||
| The experimental [TypeGPU Runtime Inspector MCP](https://www.npmjs.com/package/typegpu-runtime-inspector-mcp) exposes runtime inspection data to agent tools. | ||
| It helps agents catch runtime errors and inspect generated WGSL code alongside other useful TypeGPU runtime information. | ||
|
|
||
| Use it when your agent environment supports MCP servers and you want runtime feedback while iterating on TypeGPU programs. |
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
127 changes: 127 additions & 0 deletions
127
apps/typegpu-docs/src/content/docs/tooling/typegpu-cli.mdx
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,127 @@ | ||
| --- | ||
| title: TypeGPU CLI | ||
| description: Create a TypeGPU project or add TypeGPU to an existing project with npx typegpu@latest. | ||
| --- | ||
|
|
||
| import { Tabs, TabItem } from '@astrojs/starlight/components'; | ||
|
|
||
| The TypeGPU CLI is the project starter for TypeGPU. | ||
| Use it to scaffold a new TypeGPU project or enhance an existing project with TypeGPU dependencies and setup. | ||
|
|
||
| ## Creating a project | ||
|
|
||
| Run the CLI in the directory where you want to create your project: | ||
|
|
||
| <Tabs syncKey="package-manager"> | ||
| <TabItem label="npm" icon="seti:npm"> | ||
| ```sh frame=none | ||
| npx typegpu@latest | ||
| ``` | ||
| </TabItem> | ||
| <TabItem label="pnpm" icon="pnpm"> | ||
| ```sh frame=none | ||
| pnpm dlx typegpu@latest | ||
| ``` | ||
| </TabItem> | ||
| <TabItem label="yarn" icon="seti:yarn"> | ||
| ```sh frame=none | ||
| yarn dlx typegpu@latest | ||
| ``` | ||
| </TabItem> | ||
| <TabItem label="bun" icon="bun"> | ||
| ```sh frame=none | ||
| bunx typegpu@latest | ||
| ``` | ||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| The CLI lets you choose a project name and one of the available templates: | ||
|
|
||
| - Vite | ||
| - Vite + React | ||
| - Expo React Native | ||
| - ... and more | ||
|
|
||
| It can also install dependencies and download the official TypeGPU AI skill during setup. | ||
|
|
||
| ### Non-interactive creation | ||
|
|
||
| Use `--yes` to skip prompts and use defaults: | ||
|
|
||
| ```sh | ||
| npx typegpu@latest my-app --yes | ||
| ``` | ||
|
|
||
| You can still select the important setup choices explicitly: | ||
|
|
||
| ```sh | ||
| npx typegpu@latest my-app --yes --template vite-react --packages @typegpu/sdf --packages @typegpu/noise | ||
| ``` | ||
|
|
||
| `--yes` skips dependency installation. | ||
| Use `--agent-skills` when you want the TypeGPU AI skill installed during project creation: | ||
|
|
||
| ```sh | ||
| npx typegpu@latest my-app --yes --agent-skills | ||
| ``` | ||
|
|
||
| ## Enhancing an existing project | ||
|
|
||
| Run the CLI with `--enhance` from the root of an existing project: | ||
|
|
||
| <Tabs syncKey="package-manager"> | ||
| <TabItem label="npm" icon="seti:npm"> | ||
| ```sh frame=none | ||
| npx typegpu@latest --enhance | ||
| ``` | ||
| </TabItem> | ||
| <TabItem label="pnpm" icon="pnpm"> | ||
| ```sh frame=none | ||
| pnpm dlx typegpu@latest --enhance | ||
| ``` | ||
| </TabItem> | ||
| <TabItem label="yarn" icon="seti:yarn"> | ||
| ```sh frame=none | ||
| yarn dlx typegpu@latest --enhance | ||
| ``` | ||
| </TabItem> | ||
| <TabItem label="bun" icon="bun"> | ||
| ```sh frame=none | ||
| bunx typegpu@latest --enhance | ||
| ``` | ||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| ### Non-interactive enhancement | ||
|
|
||
| Use `--recommended` with `--yes` to apply the standard Vite-oriented TypeGPU setup without prompts: | ||
|
|
||
| ```sh | ||
| npx typegpu@latest --enhance --yes --recommended | ||
| ``` | ||
|
|
||
| You can also add ecosystem packages or the TypeGPU AI skill in the same pass: | ||
|
|
||
| ```sh | ||
| npx typegpu@latest --enhance --yes --recommended --packages @typegpu/sdf --agent-skills | ||
| ``` | ||
|
|
||
| If the CLI cannot detect a package manager, pass `--package-manager npm`, `pnpm`, `yarn`, or `bun`. | ||
|
|
||
| :::caution | ||
| Back up your project before running the enhance flow. | ||
| The CLI does not provide an automatic rollback. | ||
| ::: | ||
|
|
||
| ## Options | ||
|
|
||
| - `-y`, `--yes`: skip prompts and use defaults. | ||
| - `--template <name>`: choose `vite-simple`, `vite-complex`, `vite-react`, or `expo-simple`. | ||
| - `--packages <name>`: add a TypeGPU ecosystem package. Repeat the flag to add more. | ||
| - `--agent-skills`: download the official TypeGPU AI skill. | ||
| - `--package-manager <pm>`: choose the package manager for dependency and skill commands. | ||
| - `--recommended`: use the recommended enhance setup. | ||
|
|
||
| ## Related tools | ||
|
|
||
| If you want to convert existing WGSL shader files into TypeGPU definitions, use [tgpu-gen](/TypeGPU/tooling/tgpu-gen) instead. |
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.