Skip to content
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

[CLI] Create cg add field command #60

Open
widal001 opened this issue Jan 30, 2025 · 0 comments
Open

[CLI] Create cg add field command #60

widal001 opened this issue Jan 30, 2025 · 0 comments
Assignees
Labels
area: cli Issues related to CLI tools for the protocol

Comments

@widal001
Copy link
Collaborator

Adding a custom field

User story

As a developer defining a CommonGrants API, I want to add a new custom field with configurable options, so that I can extend the API schema easily.

Developer experience

Simplest use case: Add a custom field by specifying name and type.

cg add field <name> <type>

Additional Features

  • Provide an example value with --example.
  • Add a description using --description.

Example Usage

# Add a simple custom field
cg add field fundingAmount number

# Add a custom field with an example value
cg add field fundingAmount number --example 100000

# Add a custom field with a description
cg add field fundingAmount number --description "The total amount of funding available"

Technical details

  • The command should append the new field to the appropriate schema definition in the TypeSpec project.
  • If --example or --description is provided, they should be included as metadata in the schema definition.

@widal001 widal001 added the area: cli Issues related to CLI tools for the protocol label Jan 30, 2025
@widal001 widal001 changed the title [CLI] adding a custom field [CLI] Create cg add field command Jan 30, 2025
@widal001 widal001 self-assigned this Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cli Issues related to CLI tools for the protocol
Projects
Development

No branches or pull requests

1 participant