# Pushing code to your workspace

To make your [data models](https://docs.embeddable.com/data-modeling/writing-data-models/defining-models) and [components](https://docs.embeddable.com/component-libraries/build-components/defining-components) available in the dashboard builder, you need to push them to your Embeddable Workspace.

You can do this by running the [**push command**](https://docs.embeddable.com/getting-started/development/pushing-code#push-command), which, by default, pushes both data models and components. 

## Controlling what gets pushed

If you store your models and components in [separate repos](https://docs.embeddable.com/data-modeling/getting-setup#2-storing-models-separately), you can push them independently. 

In your component repo, in `embeddable.config`, simply set the following:

```tsx
pushModels: false,
pushComponents: true,
```

And, in your models repo, set the opposite:

```tsx
pushModels: true,
pushComponents: false,
```

During a push:

- Both values default to true if not set.
- If **`pushModels`** is true, model files (including `security-context.sc.yml`) are pushed.
- If **`pushComponents`** is true, all other component files (including `client-contexts.cc.yml`, custom types, and editors) are pushed.

### Running embeddable:dev

When building locally using [`embeddable:dev`](https://docs.embeddable.com/getting-started/development/local-environment): 

- If **`pushModels`** is false, local development uses models from your online workspace.
- If **`pushComponents`** is false, it uses components from your online workspace.
- A rebuild only occurs when files in the relevant set change (for faster iteration).

### Code version pickers in the builder

In the top menu in the dashboard builder you can use the version pickers to choose the **models version** and **components version**. Publishing a dashboard uses whichever models and components versions are currently selected when you save a version. A version is only live **once published**.

## Push command

Use the following commands:

```bash
npm run embeddable:login
```

```bash
npm run embeddable:build
```

```bash
npm run embeddable:push
```

If you have multiple workspaces, you will be prompted to select which workspace you want to push to.

## Pushing using your API Key

You can also push your models and components using your API key, which is especially useful for integrating into your **CI/CD pipeline**. You can also pass an email explicitly, and attach a push message that cen be seen in your Embeddable Workspace.

```bash
npm run embeddable:push -- --api-key <API Key> --email <Email> --message <Message>
```

For example:

```bash
npm run embeddable:push -- --api-key c26624b --email my@email.com --message "My first components and models"
```

If you're using Powershell, you may need to put the -- in double quotes, like so:

```bash
npm run embeddable:push "--" --api-key c26624b --email my@email.com --message "My first components and models"
```

---
Source: https://docs.embeddable.com/getting-started/development/pushing-code
