# 2.Pkg

{% code overflow="wrap" %}

```yaml
#Example ONLY
pkg: "Real Name, It will be Installed & Integrated based on this Value"
pkg_id: "Unique Identifier, Based on src_url, used for identifying this .pkg"
pkg_type: "Pkg Format, if empty or nonexistent, Builder reads Magic Bytes to determine format"
```

{% endcode %}

* [x] <mark style="color:purple;">**`pkg`**</mark> is the **Canonical** name of the Package. *It will be installed as this, regardless of the actual filename*. Desktop entry will also show this name (**TYPE**: <mark style="color:red;">**ENFORCED**</mark>)
* [x] [<mark style="color:purple;">**`pkg_id`**</mark>](#user-content-fn-1)[^1] is like an **`ID`**, It is **`Unique` & `NOT SHARED`** with any other <mark style="color:purple;">**`pkg_id`**</mark> from other packages (**TYPE**: <mark style="color:green;">**`RECOMMENDED`**</mark>)

> - <mark style="color:purple;">**`pkg_id`**</mark> is to make it seamless to add multiple binaries from multiple sources for the same pkg
>
> - <mark style="color:purple;">**`pkg_id`**</mark> is just <mark style="color:purple;">**`src_url`**</mark> without <mark style="color:orange;">`http|https`</mark> schema along with some extra params
>
> - Example: <mark style="color:purple;">**`src_url`**</mark>` `` ``= ` "<mark style="color:blue;">`https://`</mark><mark style="color:orange;">`github.com`</mark><mark style="color:blue;">`/`</mark><mark style="color:yellow;">`AppImager`</mark><mark style="color:blue;">`/`</mark><mark style="color:green;">`example-appimage`</mark>" --> <mark style="color:orange;">**`github.com`**</mark><mark style="color:blue;">**`.`**</mark><mark style="color:yellow;">**`AppImager`**</mark><mark style="color:blue;">**`.`**</mark><mark style="color:green;">**`example-appimage`**</mark>
>
> - Notice how, all special chars like `/` --> `.` and `http://|https://` was removed Another example, where the repo has multiple appimages:
>
> > * **`alpha`** --> github.com.AppImager.example-appimag&#x65;**.alpha**
> > * **`latest`** --> github.com.AppImager.example-appimage.**latest**
> > * **`nightly`** --> github.com.AppImager.example-appimag&#x65;**.nightly**
> > * **`stable`** --> github.com.AppImager.example-appimag&#x65;**.stable**
>
> * It's just **`$tag`** or some other identifier added at last

{% hint style="info" %}
**If you don't specify a `pkg_id`**, the first entry of <mark style="color:purple;">**`src_url`**</mark> is auto converted & added as <mark style="color:purple;">**`pkg_id`**</mark>
{% endhint %}

* [x] <mark style="color:purple;">**`pkg_type`**</mark> is the Package Format, it can be one of the following (<mark style="color:orange;">**`lowercase`**</mark>) (**TYPE**: <mark style="color:green;">**`RECOMMENDED`**</mark>)

> - [**AppImage**](/formats/packages/appimage.md) denotes it is an [AppImage](https://appimage.org/) <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**appimage**</mark>**"**
> - [**AppBundle**](/formats/packages/appbundle.md) denotes it is an [AppBundle](https://github.com/xplshn/pelf/) <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**appbundle**</mark>**"**
> - [**Archive**](/formats/packages/archive.md) denotes it is an archive (**SELF-EXTRACTABLE**) format: <mark style="color:purple;">`.7z .bz .bz2 .gz .lz4 .lzma .rar .sz .tar .xz .zst`</mark> or a mix-mash of these. This includes formats like [alpix](https://github.com/QaidVoid/alpix), [staticx](https://github.com/JonathonReinhart/staticx) etc. <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**archive**</mark>**"**
> - [**Dynamic**](/formats/binaries/dynamic.md) denotes it is a *Dynamic Binary* <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**dynamic**</mark>**"**
> - [**FlatImage**](/formats/packages/flatimage.md) denotes it is a [*FlatImage*](https://github.com/ruanformigoni/flatimage) , <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**flatimage**</mark>**"**
> - [**GameImage**](broken://pages/QbbRr9n5JK9oqWInlJrL) denotes it is a [*GameImage*](https://github.com/ruanformigoni/gameimage) , <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**gameimage**</mark>**"**
> - [**NixAppImage**](/formats/packages/nixappimage.md) denotes it is a [*NixAppImage*](https://github.com/ralismark/nix-appimage) , <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**nixappimage**</mark>**"**
> - [**RunImage** ](/formats/packages/runimage.md)denotes it is a [*RunImage*](https://github.com/VHSgunzo/runimage) , <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**runimage**</mark>**"**
> - [**Static**](/formats/binaries/static.md) denotes it is a *Static Binary* , <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**static**</mark>**"**

{% hint style="info" %}
**`Runner/Linter`** will *read the magic bytes* to determine correct format in case this field is empty.
{% endhint %}

[^1]: `pkg_id` will be *auto generated* based on `src_url` **if `pkg_id` is empty**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pkgforge.dev/sbuild/specification/2.pkg.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
