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

# jnc run

> Run tasks or commands in the workspace environment.

# jnc run

Runs a task or shell command inside the activated workspace environment. The command can be a predefined task from the manifest or an arbitrary executable found in the environment's `PATH`.

The environment is automatically installed and updated before execution if needed. Tasks defined in the manifest can depend on other tasks and will be executed in the correct topological order.

If no task is provided, `jnc run` prints a list of all available tasks.

**Alias:** `r`

## Usage

```bash theme={null}
jnc run [OPTIONS] [TASK]...
```

## Arguments

| Argument | Description                                                              |
| -------- | ------------------------------------------------------------------------ |
| `TASK`   | The task name(s) or shell command to run. Multiple tasks can be chained. |

## Options

| Option                      | Description                                                                                                                        |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `-e`, `--environment <ENV>` | The environment to run the task in.                                                                                                |
| `-x`, `--executable`        | Execute the command as a raw executable, bypassing task resolution. Useful when a task name and an executable share the same name. |
| `--clean-env`               | Run with a clean environment, ignoring variables from the current shell.                                                           |
| `--skip-deps`               | Do not run the task's `depends-on` dependencies.                                                                                   |
| `--templated`               | Enable template rendering for command arguments (e.g., `{{ jnc.platform }}`).                                                      |
| `-n`, `--dry-run`           | Print the command that would be run without executing it.                                                                          |

### Update Options

| Option         | Description                                          |
| -------------- | ---------------------------------------------------- |
| `--frozen`     | Use the lockfile as-is, do not update it.            |
| `--locked`     | Require the lockfile to be up-to-date, abort if not. |
| `--no-install` | Do not install the environment before running.       |
| `--as-is`      | Shorthand for `--frozen --no-install`.               |

### Global Options

| Option                         | Description                                                       |
| ------------------------------ | ----------------------------------------------------------------- |
| `-m`, `--manifest-path <PATH>` | Path to `jnc.toml`, `pyproject.toml`, or the workspace directory. |

## Examples

### Run a predefined task

```bash theme={null}
jnc run test
```

### Run an arbitrary command in the environment

```bash theme={null}
jnc run python -c "print('Hello!')"
```

### Run a task in a specific environment

```bash theme={null}
jnc run --environment test pytest -v
```

### Chain multiple tasks

```bash theme={null}
jnc run build test lint
```

### Run with a clean environment

```bash theme={null}
jnc run --clean-env python my_script.py
```

### Dry run to preview commands

```bash theme={null}
jnc run --dry-run test
```

### Run a raw executable (bypass task resolution)

```bash theme={null}
jnc run --executable python --version
```

### List all available tasks

```bash theme={null}
jnc run
```
