### Install and Run Storybook Source: https://github.com/palantir/osdk-ts/blob/main/packages/react-components-storybook/README.md Install dependencies and start the Storybook development server locally. The Storybook will be accessible at http://localhost:6006. ```bash pnpm install pnpm dev ``` -------------------------------- ### Run the Example People App Source: https://github.com/palantir/osdk-ts/blob/main/packages/react-components/README.md Command to run the example people app after dependencies have been transpiled. This command starts the development server for the specified package. ```bash pnpm --filter @osdk/e2e.sandbox.peopleapp dev ``` -------------------------------- ### Install @osdk/osdk-docs-context Source: https://github.com/palantir/osdk-ts/blob/main/packages/osdk-docs-context/README.md Install the package using npm or pnpm. ```bash npm install @osdk/osdk-docs-context # or pnpm add @osdk/osdk-docs-context ``` -------------------------------- ### Install Dependencies Source: https://github.com/palantir/osdk-ts/blob/main/README.md Run this command from the root of the repository to install all project dependencies. ```bash pnpm install ``` -------------------------------- ### Install Globally and Use Alias Source: https://github.com/palantir/osdk-ts/blob/main/packages/create-widget/README.md Demonstrates installing the CLI globally and using the npm create alias. ```sh npm install -g @osdk/create-widget@latest ``` ```sh npm create @osdk/widget@latest ``` -------------------------------- ### Request OSDK Examples for Loading Topic Source: https://github.com/palantir/osdk-ts/blob/main/packages/osdk-docs-context/OSDK-DOCS-CONTEXT-IN-MCP.md Example of an agent requesting OSDK examples for the 'loading' topic. The function returns a JSON string with code examples and metadata. ```typescript // Agent requests loading examples const jsonResponse = getOsdkExamples({ topic: "loading", version: "2.4.0", }); // Returns JSON string containing loadSingleObjectGuide, loadObjectPageGuide, etc. // with full code examples, file paths, and metadata ``` -------------------------------- ### Install @osdk/react-components-styles Source: https://github.com/palantir/osdk-ts/blob/main/packages/react-components-styles/README.md Install the package using npm. ```bash npm install @osdk/react-components-styles ``` -------------------------------- ### Install and Run CLI Locally Source: https://github.com/palantir/osdk-ts/blob/main/packages/create-widget/README.md Commands to install dependencies, build the project, navigate to the create-widget package, and run the CLI locally. ```sh pnpm install pnpm build cd packages/create-widget ./bin/createWidget.mjs ``` -------------------------------- ### Generate Example Files with npm Source: https://github.com/palantir/osdk-ts/blob/main/packages/typescript-sdk-docs-examples/README.md Executes the script to generate individual example files from documentation sections. This organizes code snippets by language and version. ```bash npm run generateExamples ``` -------------------------------- ### Run Development Server Source: https://github.com/palantir/osdk-ts/blob/main/packages/e2e.sandbox.todoapp/README.md Follow these steps to copy the environment sample, generate code, and start the development server. ```bash pnpm run codegen ``` ```bash pnpm dev ``` -------------------------------- ### Example Data Structure Source: https://github.com/palantir/osdk-ts/blob/main/packages/osdk-docs-context/README.md Illustrates the structure of an example object, including filePath, code, and version/variation metadata. ```json { "2.4.0": { "examples": { "loadGeotimeSeriesPointsSnippet": { "filePath": "examples/typescript/2.4.0/loadGeotimeSeriesPointsSnippet.ts", "code": "// TypeScript code here..." }, "derivedPropertyNumericExpression": { "#isUnary": { "filePath": "examples/typescript/2.4.0/derivedPropertyNumericExpression_#isUnary.ts", "code": "// Unary operation code..." }, "^isUnary": { "filePath": "examples/typescript/2.4.0/derivedPropertyNumericExpression_^isUnary.ts", "code": "// Non-unary operation code..." } } } } } ``` -------------------------------- ### Install and Build Project Locally Source: https://github.com/palantir/osdk-ts/blob/main/packages/cli/README.md Run these commands from the repository root to install dependencies and build the project locally before running the CLI. ```sh pnpm install pnpm build cd packages/cli ./bin/osdk.mjs ``` -------------------------------- ### Install @osdk/react-components Source: https://github.com/palantir/osdk-ts/blob/main/packages/react-components/README.md Install the package using npm. Ensure peer dependencies are also installed. ```sh npm install @osdk/react-components ``` -------------------------------- ### Install and Run OSDK CLI Locally Source: https://github.com/palantir/osdk-ts/blob/main/packages/create-app/README.md Commands to install dependencies, build the project, navigate to the create-app package, and run the CLI locally. Ensure you are in the repository root before executing. ```sh pnpm install pnpm build cd packages/create-app ./bin/createOsdkApp.mjs ``` -------------------------------- ### CLI Options for Example Generation Source: https://github.com/palantir/osdk-ts/blob/main/packages/typescript-docs-example-generator/README.md Available command-line options for the `generate-examples` script, including version selection and output directory configuration. ```bash generate-examples [options] --versions Comma-separated versions to generate (default: 2.1.0,2.4.0) --output-dir Output directory (default: src/examples) --hierarchy-output Path for hierarchy file (default: src/typescriptOsdkExamples.ts) --help, -h Show help ``` -------------------------------- ### Install OSDK Client and OAuth Packages Source: https://github.com/palantir/osdk-ts/blob/main/README.md Install the necessary packages for the OSDK client and OAuth functionality using npm. ```sh npm install @osdk/client npm install @osdk/oauth ``` -------------------------------- ### Troubleshoot Build Issues: Missing Examples for Version X Source: https://github.com/palantir/osdk-ts/blob/main/packages/typescript-docs-example-generator/README.md Instructions for diagnosing missing examples for a specific version. Requires confirming version existence, checking template syntax, and reviewing generation logs. ```text - Confirm version exists in `TYPESCRIPT_OSDK_SNIPPETS.versions` - Check that templates for that version have valid syntax - Review generation logs for skipped templates ``` -------------------------------- ### Search OSDK Examples Source: https://github.com/palantir/osdk-ts/blob/main/packages/osdk-docs-context/README.md Search for examples across all versions or within a specific version using keywords. ```typescript // Search examples across all versions const results = NestedOsdkExamplesContext.searchExamples("numeric"); // Search within a specific version const versionResults = NestedOsdkExamplesContext.searchExamples( "load", "2.4.0", ); ``` -------------------------------- ### Install @osdk/cbac-components Source: https://github.com/palantir/osdk-ts/blob/main/packages/cbac-components/README.md Install the beta version of the CBAC components package using npm. ```sh npm install @osdk/cbac-components@beta ``` -------------------------------- ### Define Example Response Format Source: https://github.com/palantir/osdk-ts/blob/main/packages/osdk-docs-context/OSDK-DOCS-CONTEXT-IN-MCP.md JSON structure representing the format of the OSDK examples returned by the tool. Includes topic, version, and a list of examples with code and variations. ```json { "topic": "loading", "version": "2.4.0", "examples": [ { "templateName": "loadSingleObjectGuide", "code": "// Full TypeScript code here...", "variations": { "#condition": "// Variation code if applicable" } } ] } ``` -------------------------------- ### Install OSDK Core Packages Source: https://context7.com/palantir/osdk-ts/llms.txt Install the core OSDK packages using npm. This includes the client, OAuth, and API definition packages. ```bash npm install @osdk/client @osdk/oauth @osdk/api ``` -------------------------------- ### App Setup with OsdkProvider2 Source: https://github.com/palantir/osdk-ts/blob/main/packages/cbac-components/README.md Wrap your application with OsdkProvider2, passing in a configured OSDK client. ```tsx import { createClient } from "@osdk/client"; import { OsdkProvider2 } from "@osdk/react/experimental"; const client = createClient(/* config */); function App() { return {/* components */}; } ``` -------------------------------- ### Request OSDK Examples for Aggregation Topic Source: https://github.com/palantir/osdk-ts/blob/main/packages/osdk-docs-context/OSDK-DOCS-CONTEXT-IN-MCP.md Example of an agent requesting OSDK examples for the 'aggregation' topic. The function returns a JSON string with relevant aggregation templates. ```typescript // Agent requests aggregation examples const jsonResponse = getOsdkExamples({ topic: "aggregation", version: "2.4.0", }); // Returns JSON string with countAggregationTemplate, // approximateDistinctAggregationTemplate, etc. ``` -------------------------------- ### Install OSDK Beta Packages Source: https://github.com/palantir/osdk-ts/blob/main/docs/react/getting-started.md Install the beta versions of OSDK packages using npm. Ensure all @osdk/* packages use compatible versions to avoid TypeScript errors. ```bash npm install @osdk/api@beta @osdk/client@beta @osdk/react@beta ``` -------------------------------- ### Install OSDK and React Dependencies Source: https://github.com/palantir/osdk-ts/blob/main/docs/react/prerequisites.md Install the required OSDK packages and React libraries using npm. ```bash npm install @osdk/api@beta @osdk/client@beta @osdk/react@beta npm install react react-dom ``` -------------------------------- ### Install OSDK Dependencies Source: https://github.com/palantir/osdk-ts/blob/main/packages/react-components/docs/Prerequisites.md Install the necessary OSDK packages and their peer dependencies like React. Ensure you are using the beta versions as indicated. ```bash npm install @osdk/api@beta @osdk/client@beta @osdk/react@beta npm install @osdk/react-components npm install @osdk/cbac-components # if using CBAC components npm install react react-dom classnames ``` -------------------------------- ### Understand Version Compatibility Source: https://github.com/palantir/osdk-ts/blob/main/packages/osdk-docs-context/README.md Retrieve base examples for a given version, considering semantic version fallback where newer versions include examples from older compatible versions. ```typescript // 2.4.0 includes examples from 2.0.0, 2.1.0, and 2.4.0 const examples240 = NestedOsdkExamplesContext.getBaseExamplesForVersion( "2.4.0", ); // 2.1.0 includes examples from 2.0.0 and 2.1.0 (but NOT 2.4.0) const examples210 = NestedOsdkExamplesContext.getBaseExamplesForVersion( "2.1.0", ); ``` -------------------------------- ### MCP Server Integration Example Source: https://github.com/palantir/osdk-ts/blob/main/packages/osdk-docs-context/README.md Demonstrates how to use NestedOsdkExamplesContext within an MCP server environment for stable public API access to OSDK examples. ```typescript // Perfect for MCP servers - stable public API import { NestedOsdkExamplesContext } from "@osdk/osdk-docs-context"; function getOsdkExamples(version: string, templateName?: string) { if (templateName) { return NestedOsdkExamplesContext.getExample(version, [templateName]); } return NestedOsdkExamplesContext.getExamplesWithVersionInfo(version); } ``` -------------------------------- ### Install Peer Dependencies Source: https://github.com/palantir/osdk-ts/blob/main/packages/cbac-components/README.md Install the necessary peer dependencies for @osdk/cbac-components. ```sh npm install react react-dom classnames @osdk/react @osdk/react-components ``` -------------------------------- ### Build and Run Generator Commands Source: https://github.com/palantir/osdk-ts/blob/main/packages/typescript-docs-example-generator/README.md Commands to build the generator, run tests, generate examples, and run generation with custom options. ```bash # Build the generator pnpm build # Run tests pnpm test # Generate examples (from parent directory) pnpm generateExamples # With custom options ./bin/generate-examples.mjs --versions 2.1.0,2.4.0 --output-dir dist/examples ``` -------------------------------- ### Run OSDK CLI with Arguments Source: https://github.com/palantir/osdk-ts/blob/main/packages/create-app/README.md Example of how to run the OSDK CLI with a project name and options. Use this to bypass interactive prompts and configure your application directly. ```sh npx @osdk/create-app [project] [--