File size: 1,532 Bytes
f14b4e9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | # Quick start
## Initialize your workspace
The easiest way to start is by running `firm init` in an empty directory:
```bash
mkdir my_workspace
cd my_workspace
firm init
```
This interactive command will help you set up your workspace by:
- Creating default schemas for common entity types (Person, Organization, Task, etc.)
- Adding a `.gitignore` file for Firm's graph files
- Creating starter entities (you and your organization)
- Adding AI context documentation for AI coding assistants
Once initialized, your workspace is ready to use!
## Add your first entity
Use `firm add` to generate new entities. The CLI will prompt you for the necessary info and generate corresponding DSL.
```bash
$ firm add
```
```
Adding new entity
> Type: organization
> ID: megacorp
> Name: Megacorp Ltd.
> Email: mega@corp.com
> Urls: ["corp.com"]
Writing generated DSL to file my_workspace/generated/organization.firm
```
You can also use `firm add` non-interactively by providing its type, ID and fields:
```bash
$ firm add --type organization --id megacorp --field name "Megacorp Ltd."
```
## View your entities
Use `firm list` to see all entities of a specific type:
```bash
$ firm list organization
```
```
Found 1 entities with type 'organization'
ID: organization.megacorp
Name: Megacorp Ltd.
Email: mega@corp.com
Urls: ["corp.com"]
```
## Query your data
Once you have a few entities, you can search and filter them using Firm's query language:
```bash
$ firm query 'from organization | where name contains "Mega"'
```
|