Skip to content

Brick-CMS/brick-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 https://brick-cms.com/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:

  1. Initialize the CLI in your project
yarn brick init
  1. 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!]!
}
  1. Run Codegen with your favorite GraphQL client like urql, or Apollo
# brick-codegen.yml
overwrite: true
schema: "https://api.brick-cms.com/my-organization-slug"
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
  1. Fetch your content!
query GetPosts {
  posts {
    title
  }
}

Documentation

For further reading, check out https://brick-cms.com/docs

About

Companion CLI for Brick CMS: a 100% GraphQL Powered Content Platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published