c3l is a library manager for C3 projects. It streamlines the process of
fetching, updating, and managing C3 libraries from remote repositories. With
c3l, all metadata about your libraries is tracked in a simple .c3l.deps file,
making maintenance and versioning of your project dependencies effortless.
No more manual cloning with c3l!
- Fetch libraries: Download and integrate remote C3 libraries into your project with a single command.
- Simple updates: Easily update libraries to newer versions, using tagged releases.
- Safe removal: Uninstall libraries cleanly without manually touching
project.json. - Seamless workflow: Keeps your project files organized and in sync with your dependencies.
- When you use c3l to add a library to your project, it:
- Fetches the library from the specified remote repository.
- Updates your project files to include the new dependency.
- Writes an entry to
.c3l.depswith some meta information.
- Updates and removals use the data in
.c3l.depsto ensure reliability. - Updating a dependency (to a new tagged release) is as easy as running a single c3l command.
Download and install c3l:
git clone https://github.com/konimarti/c3l
cd c3l
sudo make installc3l will be installed in /usr/local/bin by default and the man page in
/usr/local/man/.
If you want to install to a different location, set the PREFIX
variable:
make PREFIX=~/.local/ installc3l fetch https://github.com/username/libname v1.0.0- Fetches the specified C3 library and registers it in
.c3l.depsandproject.json.
c3l update libname- Updates the library to the newest tagged release, updating the metadata in
.c3l.deps.
c3l remove libname- Uninstalls the library and removes its entry from
.c3l.depsandproject.json.
c3l pull- Fetches all libraries from
.c3l.deps. This is only required when a project is freshly cloned and only.c3l.depsis present.
Some relevant dependency information—including name, source URL, current version or
tag—is stored in a .c3l.deps file at your project root. This enables:
- Easy auditing of all dependencies in use
- Clean removal and easy updating
You need the C3 compiler
c3c to run this example.
# Create a new C3 project
c3c init app && cd app
# Update main.c3
cat <<EOF > src/main.c3
import encoding::hex;
fn void main() => (void)hex::dump_bytes("C3 is great");
EOF
# Add the required library
c3l fetch https://github.com/konimarti/hex.c3l v0.1.1
# Now run the app
c3c run
# Update a library to the newest release
c3l update hex
# List installed libraries
c3l list
# Remove a library
c3l remove hexMIT. See LICENSE for full text.
Contributions welcome! Please open an issue or submit a pull request to get started.