Skip to content

Configuration

Pinecone uses a pine.config.json file to configure your project.

Config File Location

By default, Pinecone looks for pine.config.json in the current directory. You can specify a different path using the --config flag:

pinecone build --config path/to/pine.config.json

Options

entry

Required - Path to your main PineScript entry file.

{
  "entry": "src/main.pine"
}

The path is relative to the config file location.

output

Required - Path where the bundled output will be written.

{
  "output": "dist/bundle.pine"
}

The directory will be created if it doesn't exist.

Complete Example

{
  "entry": "src/main.pine",
  "output": "dist/bundle.pine"
}

Import and Export Directives

Exporting

Use // @export to mark functions for export:

//@version=5
// @export functionName

functionName(x) =>
    x * 2

Export multiple functions:

// @export foo, bar, baz

Importing

Use // @import to import functions from other files:

// @import { functionName } from "./path/to/file.pine"

Import multiple functions:

// @import { foo, bar, baz } from "./utils.pine"

Path Requirements

  • Paths must be relative (start with ./ or ../)
  • Paths must include the .pine extension
  • Use forward slashes / even on Windows

Project Structure

A typical project structure:

my-project/
├── pine.config.json
├── dist/
│   └── bundle.pine      # Generated output
└── src/
    ├── main.pine        # Entry point
    ├── utils/
    │   ├── math.pine
    │   └── format.pine
    └── indicators/
        ├── rsi.pine
        └── macd.pine

You can organize your files however you like - Pinecone will resolve all imports automatically.