Skip to content

Commit

Permalink
Merge pull request #5 from gibsongd/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
fenix-hub committed Apr 24, 2022
2 parents 15c7d06 + 2377ef2 commit 76d779f
Show file tree
Hide file tree
Showing 28 changed files with 2,372 additions and 470 deletions.
231 changes: 122 additions & 109 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,109 +1,122 @@
# gibson-cli
Golang CLI tool for Gibson framework: package manager, project manager, godot cli parser, class resolver, etc...

## Modules
- [x] [Package Manager](#package-manager)
- [ ] [Project Manager]()
- [ ] [CLI Parser]()
- [ ] [Class Resolver]()

## Installation
### with GO
If you have [go already installed](https://go.dev/doc/install) on your machine:
```bash
go install https://github.com/gibsongd/gibson-cli
```
and gibson will be ready to serve you!

### without GO
Download binaries at your choice from the [latest release](https://github.com/gibsongd/gibson-cli/releases).
Unzip gibson binaries wherever you want and
- on linux, move `gibson` binaries to `/usr/bin`
- on windows, add `gibson.exe` folder to `%PATH%` environment variable

### Package Manager
Gibson package manager lets you install addons in your Godot projects.
Gibson handles assets in a very similar (yet liter) way to `npm`.
Addons are installed only from one trusted source, which is the official [AssetLib](https://godotengine.org/asset-library/asset) using their public APIs.
Once installed, addons will be cached in your `$HOME/.cache` (*unix*) or `%LocalAppData%` (*windows*) folder, so all your Godot projects will be able to share addons just executing one command!

#### examples

*search for an addon*
```bash
> gibson pm -search "time"

[id] [user] [title]
1275 Blaron Timer Counter
1157 Aendryr Date Time Addon
1134 GianptDev EditorTimer
1127 RipeX Simple Project Timer
236 thomazthz Godot Wakatime
721 VolodyaKEK Single File Runtime Console
702 Eminnet EminMultiMesh
662 pycbouh Time Tracker
342 Cevantime Water2D Node
```

*install an addon by `author/title`*
```bash
> gibson pm -install "pycbouh/Time Tracker"

[gibson-cli] ✓
[gibson-cli] ✓ `pycbouh/Time Tracker` fetched!
[gibson-cli] ✓ `662` info retrieved!
[gibson-cli] ✓ `pycbouh/Time Tracker` downloaded!
[gibson-cli] ✓ `pycbouh/Time Tracker` installed successfully!
```

*install an addon by `id`*
```bash
> gibson pm -install 662

[gibson-cli] ✓
[gibson-cli] ✓ `662` info retrieved!
[gibson-cli] ✓ `pycbouh/Time Tracker` downloaded!
[gibson-cli] ✓ `pycbouh/Time Tracker` installed successfully!
```

When an addon is installed, it will create a `gibson.json` in the current folder.
It is used by *gibson* in order to handle addons.
If an addon is already cached, it will just be unpacked in the current project.

*install an addon by `author/title` (cached)*
```bash
> gibson pm -install "pycbouh/Time Tracker"

[gibson-cli] ✓ `pycbouh/Time Tracker` found in cache
[gibson-cli] ✓ `pycbouh/Time Tracker` installed successfully!
```

*Want to clear the cache and force install?*
```bash
> gibson pm -install "pycbouh/Time Tracker" -clear

[gibson-cli] ✓ `pycbouh/Time Tracker` cache cleared
[gibson-cli] ✓ `pycbouh/Time Tracker` fetched!
[gibson-cli] ✓ `662` info retrieved!
[gibson-cli] ✓ `pycbouh/Time Tracker` downloaded!
[gibson-cli] ✓ `pycbouh/Time Tracker` installed successfully!
```

*uninstall an addon*
```bash
> gibson pm -uninstall "pycbouh/Time Tracker"

[gibson-cli] ✓ `time-tracker` removed
[gibson-cli] ✓ `pycbouh/Time Tracker` uninstalled
```

*install all the addons listed in the `gibson.json` file*
```bash
> gibson pm -install .
```
This is useful if you want to share your project and leave it addons-independent or want to make a lighter project.

*list all addons currently installed (using gibson)*
```bash
> gibson pm -list
```
# gibson-cli
Golang CLI tool for Gibson framework: package manager, project manager, godot cli parser, class resolver, etc...

## Modules
- [x] [Package Manager](#package-manager)
- [ ] [Project Manager]()
- [ ] [CLI Parser]()
- [ ] [Class Resolver]()

## Installation
### with GO
If you have [go already installed](https://go.dev/doc/install) on your machine:
```bash
go install https://github.com/gibsongd/gibson-cli
```
and gibson will be ready to serve you!

### without GO
Download binaries at your choice from the [latest release](https://github.com/gibsongd/gibson-cli/releases).
Unzip gibson binaries wherever you want and
- on linux, move `gibson` binaries to `/usr/bin`
- on windows, add `gibson.exe` folder to `%PATH%` environment variable

### Package Manager
Gibson package manager lets you install addons in your Godot projects.
Gibson handles assets in a very similar (yet liter) way to `npm`.
Addons are installed only from one trusted source, which is the official [AssetLib](https://godotengine.org/asset-library/asset) using their public APIs.
Once installed, addons will be cached in your `$HOME/.cache` (*unix*) or `%LocalAppData%` (*windows*) folder, so all your Godot projects will be able to share addons just executing one command!

#### examples

*search for an addon*
```bash
> gibson pm search time
or
> gibson pm search "time"

[id] [user] [title]
1275 Blaron Timer Counter
1157 Aendryr Date Time Addon
1134 GianptDev EditorTimer
1127 RipeX Simple Project Timer
236 thomazthz Godot Wakatime
721 VolodyaKEK Single File Runtime Console
702 Eminnet EminMultiMesh
662 pycbouh Time Tracker
342 Cevantime Water2D Node
```

*install an addon by `author/title`*
```bash
> gibson package_manager install "fenix/Godot Engine JWT"
or
> gibson pm i "fenix/Godot Engine JWT"

[gibson-cli] ✓ `fenix/Godot Engine JWT` found!
[gibson-cli] ✓ `fenix/Godot Engine JWT` info retrieved!
[gibson-cli] ✓ `fenix/Godot Engine JWT` downloaded!
[gibson-cli] ✓ `fenix/Godot Engine JWT` installed successfully!

```

*install an addon by `id`*
```bash
> gibson pm i 1104

[gibson-cli] ✓ `fenix/Godot Engine JWT` info retrieved!
[gibson-cli] ✓ `fenix/Godot Engine JWT` downloaded!
[gibson-cli] ✓ `fenix/Godot Engine JWT` installed successfully!
```

When an addon is installed, it will create a `gibson.json` in the current folder.
It is used by *gibson* in order to handle addons.
If an addon is already cached, it will just be unpacked in the current project.

*install an addon by `author/title` (cached)*
```bash
> gibson pm i "fenix/Godot Engine JWT"

[gibson-cli] ✓ `fenix/Godot Engine JWT` found in cache
[gibson-cli] ✓ `fenix/Godot Engine JWT` installed successfully!
```

*Want to force install?*
```bash
> gibson pm i "fenix/Godot Engine JWT" --force || -f
```

*uninstall an addon*
```bash
> gibson pm uninstall "fenix/Godot Engine JWT"

[gibson-cli] ✓ `fenix/Godot Engine JWT` removed
[gibson-cli] ✓ `fenix/Godot Engine JWT` uninstalled
```

*uninstall an addon and clear all the cached versions *
```bash
> gibson pm uninstall "fenix/Godot Engine JWT" --clear || -c

[gibson-cli] ✓ `fenix/Godot Engine JWT` cache cleared
[gibson-cli] ✓ `fenix/Godot Engine JWT` removed
[gibson-cli] ✓ `fenix/Godot Engine JWT` uninstalled
```

*install all the addons listed in the `gibson.json` file*
```bash
> gibson pm i
```
This is useful if you want to share your project and leave it addons-independent or want to make a lighter project.

*list all addons currently installed (using gibson)*
```bash
> gibson pm list

assets/
├─ dialogue_editor/ 1200 (VP-GAMES/Dialogue Editor (G4))
├─ draw3d/ 1301 (nyxkn/Draw3D)
├─ jwt/ 1104 (fenix/Godot Engine JWT)
├─ stream_comment/ 1300 (velop/Stream Comment)
└─ telegram-bot-api/ 1072 (fenix/Telegram Bot API)
```
30 changes: 30 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package cmd

import (
cmd "gibson/package_manager/cmd"
"os"

"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
Use: "gibson",
Short: "The Gibson CLI.",
Long: ``,
}

func AddCommand(cmds *cobra.Command) {
rootCmd.AddCommand(cmds)
}

func Execute() {
err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
}

func init() {
rootCmd.AddCommand(cmd.PackageManager)
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
12 changes: 11 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@ module gibson

go 1.18

require golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5

require (
github.com/antihax/optional v1.0.0
github.com/fatih/color v1.13.0 // indirect
github.com/golang/protobuf v1.4.2 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/spf13/cobra v1.4.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/theckman/yacspin v0.13.12 // indirect
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/protobuf v1.25.0 // indirect
)

0 comments on commit 76d779f

Please sign in to comment.