wikijs-rs

API bindings, CLI client and FUSE filesystem for Wiki.js written in Rust.
What's inside?
- Library: Rust bindings to Wiki.js's entire GraphQL API as well as asset up- and download via the REST API. Usable but not battle-tested
- CLI: Command-line client for those bindings allowing things like editing pages with your editor. Usable but not complete yet
- Filesystem: A FUSE filesystem to mount your wiki and work on it locally. Not usable yet, heavily work-in-progress.
Library
The library basically gives you a struct Api that you hand the url and
credentials for you Wiki.js instance to, and that exposes functions for all
the different GraphQL queries and mutations as well as asset down- and upload
via the REST API. For detailed information check the
documentation, otherwise here a short example:
Usage
Add the following dependency to your Cargo.toml:
[]
= "0.1"
Create an instance of Api and use its functions:
use ;
let api = new;
println!;
CLI
This crate ships a command-line tool also called wikijs to directly interact
with your Wiki.js instance from the CLI. On top of exposing the library
functions it also offers additional functionality like editing pages with
your favorite editor.
Build
Install
Usage
The tool takes the URL and credentials either from the arguments or environment variables. For the latter option use something like this:
Then you can for example create a page named test, list pages and edit
it with:
where the ID is found in the page list output.
Filesystem
WARNING: Not really usable yet! Careful!*
Also in case you wanna PR on this please coordinate via issues, as I'm currently heavily refactoring this to add a caching layer and include assets.
This crate also ships FUSE filesystem called wikifs to mount your Wiki.js
instance locally and view and manipulate it with what ever programs you like.
Build
Install
Usage
The tool takes the URL and credentials either from the arguments or environment variables. For the latter option use something like this:
Then you can mount the filesystem like so:
And in another terminal use it like this:
provided you have a markdown page located at /test in your wiki.
Contributing
Use small commits that make isolated changes to a single module and name them according to conventional commits.
Two parts where especially first-time contributions should be fairly easy and are also really needed is writing docstrings and integration tests. Apart from that the CLI still needs to implement many of the library functions.
Please check issues and PRs first and maybe make an issue or draft PR of your own so we can coordinate work. This is especially important for the FUSE filesystem, as I'm currently heavily refactoring that.