> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudstic.com/llms.txt
> Use this file to discover all available pages before exploring further.

# cloudstic profile new

> Create or update a backup profile in profiles.yaml

Create or update a named backup profile that links a source, store, and optional auth entry. Profiles save your backup configuration for reuse with `cloudstic backup -profile <name>`.

## Usage

```bash theme={null}
cloudstic profile new [options]
```

In interactive mode, you'll be prompted for missing required fields and offered to select or create stores and auth entries.

If `profile new` creates a new store, it now reuses the same encryption setup
flow as `store new` (including secret reference/native secret storage prompts).

## Options

<ParamField path="-name" type="string" required>
  Profile name. If a profile with this name already exists, its values are updated.
</ParamField>

<ParamField path="-source" type="string" required>
  Source URI for this profile. Formats: `local:<path>`, `sftp://[user@]host[:port]/<path>`, `gdrive[://<Drive>][/<path>]`, `gdrive-changes[://<Drive>][/<path>]`, `onedrive[://<Drive>][/<path>]`, `onedrive-changes[://<Drive>][/<path>]`.
</ParamField>

<ParamField path="-store-ref" type="string" required>
  Name of an existing store entry to use. The store must already exist in the profiles file (or be created with `-store`).
</ParamField>

<ParamField path="-store" type="string">
  Store URI. When combined with `-store-ref`, creates or updates the store entry with this URI.
</ParamField>

<ParamField path="-auth-ref" type="string">
  Name of an existing auth entry. Required for cloud sources (gdrive, onedrive).
</ParamField>

<ParamField path="-tag" type="string" repeatable>
  Tag to apply to snapshots created by this profile.
</ParamField>

<ParamField path="-exclude" type="string" repeatable>
  Exclude pattern (gitignore syntax).
</ParamField>

<ParamField path="-exclude-file" type="string">
  Path to a file containing exclude patterns.
</ParamField>

<ParamField path="-ignore-empty-snapshot" type="boolean" default="false">
  Skip creating a new snapshot for this profile when the resulting tree is unchanged.
</ParamField>

<ParamField path="-skip-native-files" type="boolean" default="false">
  Exclude Google-native files (Docs, Sheets, Slides) from backups.
</ParamField>

<ParamField path="-volume-uuid" type="string">
  Override volume UUID for local sources.
</ParamField>

<ParamField path="-google-credentials" type="string">
  Path to Google service account credentials JSON.
</ParamField>

<ParamField path="-google-token-file" type="string">
  Path to Google OAuth token file.
</ParamField>

<ParamField path="-onedrive-client-id" type="string">
  OneDrive OAuth client ID.
</ParamField>

<ParamField path="-onedrive-token-file" type="string">
  Path to OneDrive OAuth token file.
</ParamField>

<ParamField path="-profiles-file" type="string" env="CLOUDSTIC_PROFILES_FILE">
  Path to the profiles YAML file.
</ParamField>

<ParamField path="--no-prompt" type="boolean" default="false">
  Disable interactive prompts. Missing required fields cause an error.
</ParamField>

## Examples

<CodeGroup>
  ```bash Local Source theme={null}
  cloudstic profile new \
    -name documents \
    -source local:~/Documents \
    -store-ref prod-s3
  ```

  ```bash Google Drive with Auth theme={null}
  cloudstic profile new \
    -name gdrive \
    -source gdrive-changes \
    -store-ref prod-s3 \
    -auth-ref google-main
  ```

  ```bash With Tags and Exclusions theme={null}
  cloudstic profile new \
    -name project \
    -source local:~/project \
    -store-ref prod-s3 \
    -tag production \
    -exclude "node_modules/" \
    -exclude ".git/" \
    -exclude-file .cloudsticignore \
    -ignore-empty-snapshot
  ```

  ```bash Create Store Inline theme={null}
  cloudstic profile new \
    -name documents \
    -source local:~/Documents \
    -store-ref my-store \
    -store s3:my-bucket/backups
  ```
</CodeGroup>

## Editing Existing Profiles

Run `profile new` with the same name. Existing values are preserved. Only the flags you provide are updated:

```bash theme={null}
# Original profile
cloudstic profile new -name docs -source local:~/Documents -store-ref prod-s3

# Later, add an exclusion (source and store-ref are preserved)
cloudstic profile new -name docs -exclude "*.log"
```

## Interactive Mode

When running interactively without all required flags, you'll be guided through the setup:

```
Profile name: documents
Source URI: local:~/Documents
Select a store
  1) Create new store
  2) prod-s3
  3) local-backup
Select option number [1]: 2
Profile "documents" saved in ~/.config/cloudstic/profiles.yaml
```

If you choose **Create new store**, Cloudstic prompts for store URI, then runs
the same encryption setup workflow as `store new`.

* Password/platform key options can be saved as `env://...` refs.
* Native secret stores can also be selected:
  * macOS `keychain://...`
  * Windows `wincred://...`
  * Linux `secret-service://...`

For cloud sources, an auth entry is also required:

```
Source URI: gdrive-changes
Select google auth entry
  1) Create new auth
  2) google-main
Select option number [1]: 2
```

## Source Validation

Source URIs are validated when creating a profile. Invalid URIs are rejected:

```
$ cloudstic profile new -name test -source invalid -store-ref x
unknown source "invalid": supported values are local:<path>, ...
```

## See Also

* [cloudstic profile list](/commands/profile-list): List all profiles
* [cloudstic profile show](/commands/profile-show): Show profile details
* [cloudstic backup](/commands/backup): Run a backup with `-profile`
* [Using Profiles](/guides/profiles): Complete profiles guide
