# qlot
- [qlot | Quickdocs](https://quickdocs.org/qlot)
## What qlot is trying to solve
> We have Quicklisp, the central library registry. It made installation of libraries damn easy.
>
> However, what only you can specify is the month of distribution. Which means you have to use all libraries of the same moment and you cannot use a newer/older version of a library for your project.
>
> "local-projects/" or ASDF configurations may be a solution to this problem, but there are a couple of problems.
>
> 1. _They are not project-local._ If you have multiple projects that use the different version of the same library, it would be a problem.
>
> 2. _They are difficult to fix the version or to update them._ If your project need to work on other than your machine, for instance on other people's machine or on servers, the version of depending libraries should be the same.
>
>
> This is what Qlot is trying to solve.
---
> [!ai]+ Claude
>
> Certainly! Here's an expanded overview of the Tutorial and Commands sections of Qlot, including concrete code examples:
### 7. Tutorial and Syntax Guide
#### Starting with Qlot
- **Initialization**: To start using Qlot in your project, you first initialize it in your project directory. This will create a `qlfile`, a `qlfile.lock`, and a `.qlot/` directory.
```bash
$ qlot init
```
- **Version Control**: It's important to add `qlfile` and `qlfile.lock` to your version-controlled repository.
```bash
$ git add qlfile qlfile.lock
$ git commit -m 'Start using Qlot.'
```
#### Adding a New Dependency
- **Using `qlot add` Command**: You can add new libraries from Quicklisp or GitHub repositories directly.
```bash
$ qlot add <library name> # Add from Quicklisp
$ qlot add github <username/repository> # Add from a GitHub repository
```
- **Editing `qlfile` Directly**: Alternatively, you can manually edit the `qlfile` and then run `qlot install` to install new dependencies.
#### Updating the Project-Local Quicklisp
- **General Update**: Update all dependencies.
```bash
$ qlot update
```
- **Specific Update**: Update specific libraries.
```bash
$ qlot update mito
$ qlot update mito sxql
```
### 8. Commands Overview
#### `install`
- **Function**: Installs Quicklisp and libraries declared in `qlfile` project-locally. Uses `qlfile.lock` if it exists.
- **Example**:
```bash
$ qlot install
$ qlot install /path/to/myapp/qlfile
```
#### `update`
- **Function**: Updates the project-local `.qlot/` directory using `qlfile`.
- **Example**:
```bash
$ qlot update
# Update a specific library
$ qlot update mito
$ qlot update mito sxql
```
#### `add`
- **Function**: Adds a line to `qlfile` and invokes `qlot install`. Arguments match the `qlfile` syntax.
- **Example**:
```bash
$ qlot add mito # Equivalent to 'ql mito'
$ qlot add ultralisp egao1980-cl-idna # Add from Ultralisp
$ qlot add github fukamachi/datafly # Add from GitHub
```
#### `exec`
- **Function**: Configures ASDF's source registries and executes a given command with arguments.
- **Usage**:
- Primarily for Roswell scripts.
- If not using Roswell, load `.qlot/setup.lisp` instead.
- **Example**:
```bash
# Roswell usage
$ qlot exec ros emacs
# Non-Roswell usage
$ sbcl --noinform --no-userinit --no-sysinit --load .qlot/setup.lisp
```
### qlfile Syntax
- **Structure**: The `qlfile` is a collection of Quicklisp distribution declarations. Each line represents a distribution source and a project name, possibly with additional arguments.
- **Sources**: Can be `dist`, `ql`, `ultralisp`, `http`, `git`, or `github`.
- **Examples**:
- Quicklisp source: `ql clack 2014-01-13`
- GitHub source: `github fukamachi/datafly :branch develop`
- Local source: `local rove ~/Programs/lib/rove`
- Custom Quicklisp dist: `dist ultralisp http://dist.ultralisp.org/`