CLI 工具 - Vafast

Automates Vafast API type synchronization by generating TypeScript files from a server URL and output path.

Updated Aug 25, 2025
One-click install
npx skills add https://github.com/vafast/vafast-docs --skill cli-vafast
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: CLI 工具 - Vafast
Source: https://github.com/vafast/vafast-docs/tree/main/docs/tools
Command: npx skills add https://github.com/vafast/vafast-docs --skill cli-vafast

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the synchronization of API type definitions between your Vafast server and clients, ensuring cross-repository type safety and reducing manual errors.

Core Features & Use Cases

  • API Type Synchronization: Automatically fetch API contract definitions from a server and generate TypeScript types.
  • Cross-Repository Type Safety: Maintain consistent and accurate API types across different services or projects.
  • Use Case: Ensure your frontend application always has the latest, correctly typed API endpoints by running a simple command before your build process.

Quick Start

Run 'npx vafast sync --url http://localhost:3000' to synchronize API types from the specified server URL.

Frequently Asked Questions about CLI 工具 - Vafast

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate API type synchronization from a server to a TypeScript client?

API type synchronization is automated by fetching API contract definitions from a Vafast server and generating TypeScript files, ensuring cross-repository type safety and reducing manual errors. You can run a simple CLI command to fetch and generate the required types before your build process.

What is the best way to maintain consistent API types across multiple repositories?

Maintaining consistent API types across repositories involves automatically fetching API contract definitions from a central server to generate matching TypeScript files. This ensures your frontend application always has the latest, correctly typed API endpoints without manual updates.

How do I specify the output file path and server URL when generating TypeScript types?

Specifying the server URL and output file path is handled via CLI arguments like '--url' for the server endpoint. The tool supports specifying the server URL, output file path, API endpoint, and path stripping for flexible integration into various project structures.

Does Vafast CLI support stripping base paths for flexible project integration?

Yes, Vafast CLI supports path stripping to allow flexible integration into various project structures. Along with specifying the server URL and output file path, path stripping ensures the generated TypeScript files align correctly with your local directory configuration.

Can I use Vafast to generate TypeScript types for frontend applications before a build process?

Yes, you can use Vafast to generate TypeScript types for frontend applications by running a simple command before your build process. This automatically fetches the latest API contract definitions from the server to ensure your application uses correctly typed endpoints.

Why do I need an API synchronization tool instead of manually updating TypeScript type definitions?

An API synchronization tool is needed to eliminate manual errors and ensure cross-repository type safety when API contracts change. By automatically fetching definitions and generating TypeScript files, it guarantees your client projects always use accurate, up-to-date types.