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

# Making Standard Packages

> Make Standard Packages (Apps) with multiple Standard files.

The Standard System supports creating Standard Packages. Standard Packages are apps that can contain your own standards and standard code.

## Building the Package

<Steps>
  <Step title="Create a folder with your app name">
    Let's use 'Hello World' as an example
  </Step>

  <Step title="Add a config.conf">
    The `config.conf` should be in the main app folder, do not nest. Add a package name property. The package name cannot contain numbers or whitespace.

    ```yaml theme={null}
    package: helloworld
    ```
  </Step>

  <Step title="Add Standards">
    You may add standards to your Standard Package. If you do, create a folder `standards`in the primary app folder and add individual `.stds` files for each standard or use the installed system standards.
  </Step>

  <Step title="Add Code">
    Add any `.std` files or other folders containing `.std` files as the code of your package.
  </Step>

  <Step title="Pack and Import">
    To pack your app, zip the app folder and rename to change the extension to `.spk` instead of `.zip`. Then, in the Standard System CLI run the pack command.

    ```text theme={null}
    pack "/path/to/Hello World.spk"
    ```

    The system unpacks the bundle, reads the package name from `config.conf`, and installs it under the local package store at `.store/spks/`. If the package name already exists, Standard prompts before overwriting it.
  </Step>

  <Step title="Run">
    Run the package by package name.

    ```text theme={null}
    run helloworld
    ```

    You can also run it by the installed folder identifier if you know the folder name under `.store/spks/`.
  </Step>
</Steps>

## Start Key

Packages are read, checked, and ran in alphabetical order for file name. To indicate where you'd like your app to start, use a `^`. In the example below, the `main.std` will be ran first as it contains the start key, even though `auto.std` comes before `main.std`.

```ruby main.std theme={null}
^
print "Hello"
in name "What's your name?"
print ("Hello ".name."!")
```

```ruby auto.std theme={null}
print "Got here second"
```

So for a large package, you may have a file that contains functions and a file that performs the operations.

```ruby helper.std theme={null}
myFunc: name {
	print ("hello ".name."!")
}
```

```ruby start.std theme={null}
^
print "Hello"
in name "What's your name?"

#Now use function from helper.std
print myFunc: name
```

Output

```text highlight={2} theme={null}
Hello
What's your name? [John Doe]
Hello John Doe!
```
