@brick-cms/cli
v1.0.11
Published
Companion CLI for brick-cms.com
Downloads
3
Readme
Brick CLI
This is the command line interface for working with Brick Schemas on brick-cms.com
Installation
yarn add -D @brick-cms/cli
Getting Started
If you've just installed the CLI, you'll also want to head over to brickcms.io/signup and create an account. You can then create an API key from within your organization settings.
From there, you can take the following steps to get started:
- Initialize the CLI in your project
yarn brick init
- Add some types to your
brick.graphqls
schema file (or use a template):
interface Brick {
id: String!
}
type Post implements Brick {
id: String!
title: String!
# ...
}
type Query {
posts: [Post!]!
}
# brick-codegen.yml
overwrite: true
schema: "https://api.brick-cms.com/my-organization"
generates:
src/bricktypes.ts:
plugins:
- "typescript"
- "typescript-operations"
config:
nonOptionalTypename: true
useImplementingTypes: true
// package.json
{
"scripts": {
"brick codegen": "graphql-codegen --config brick-codegen.yml"
}
}
yarn brick codegen
- Fetch your content!
query GetPosts {
posts {
title
}
}
Documentation
For further reading, check out brick-cms.com/docs