Skip to content

Commit

Permalink
Merge pull request #140 from richardschneider/138-csipfs
Browse files Browse the repository at this point in the history
csipfs tool
  • Loading branch information
richardschneider authored Aug 16, 2019
2 parents 882372d + b56849c commit c9d16d0
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ before_script:
script:
- dotnet build -c Release --no-restore --framework netstandard2 ./src
- dotnet test --logger "console;verbosity=normal" -c Release --no-restore --framework netcoreapp2.2 ./test --filter TestCategory!=IPv6
- dotnet build -c Release --no-restore --framework netcoreapp2.2 ./IpfsCli
- dotnet tool install --global --add-source IpfsCli/bin/Release csipfs
- $HOME/.dotnet/tools/csipfs --help
2 changes: 1 addition & 1 deletion IpfsCli/CommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ abstract class CommandBase
{
protected virtual Task<int> OnExecute(CommandLineApplication app)
{
app.Error.WriteLine($"The command '{app.Name}' is not implemented.");
app.Error.WriteLine($"The command '{app.Name}' is not implemented yet.");
return Task.FromResult(1);
}
}
Expand Down
24 changes: 23 additions & 1 deletion IpfsCli/IpfsCli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,32 @@

<AssemblyName>csipfs</AssemblyName>
<RootNamespace>Ipfs.Cli</RootNamespace>


<PackAsTool>true</PackAsTool>
<ToolCommandName>csipfs</ToolCommandName>
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
<IsPackable>true</IsPackable>
<IsShippingPackage>true</IsShippingPackage>
<AllowedReferenceRelatedFileExtensions Condition=" '$(Configuration)' == 'Release' ">
<!-- Prevent default XML and PDB files copied to output in RELEASE. Only *.allowedextension files will be included, which doesn't exist in my case. -->
*.pdb;
*.xml
</AllowedReferenceRelatedFileExtensions>
<!-- developer build is always 0.42 -->
<AssemblyVersion>0.42</AssemblyVersion>
<Version>0.42</Version>

<!-- Nuget specs -->
<PackageId>csipfs</PackageId>
<Authors>Richard Schneider</Authors>
<Title>C# IPFS CLI</Title>
<Description>The command line tool to IPFS engine for .Net</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>https://github.com/richardschneider/net-ipfs-engine/releases</PackageReleaseNotes>
<Copyright>© 2018-2019 Richard Schneider</Copyright>
<PackageTags>ipfs peer-to-peer p2p distributed file-system web</PackageTags>
<PackageProjectUrl>https://github.com/richardschneider/net-ipfs-engine</PackageProjectUrl>
<PackageIconUrl>https://raw.githubusercontent.com/richardschneider/net-ipfs-core/master/doc/images/ipfs-cs-logo-64x64.png</PackageIconUrl>
</PropertyGroup>

<ItemGroup>
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ string text = await ipfs.FileSystem.ReadAllTextAsync(filename);

## Related projects

- [IPFS Core](https://github.com/richardschneider/net-ipfs-core)
- [IPFS HTTP Client](https://github.com/richardschneider/net-ipfs-http-client)
- [IPFS HTTP Gateway](https://github.com/richardschneider/net-ipfs-http-gateway)
- [Peer Talk](https://github.com/richardschneider/peer-talk)
- [IPFS Core](https://github.com/richardschneider/net-ipfs-core) - Core IPFS objects and interfaces.
- [IPFS DSL](https://github.com/cloveekprojeqt/ipfs-dsl) - A declarative embedded language for building compositional programs and protocols over the InterPlanetary File System.
- [IPFS HTTP Client](https://github.com/richardschneider/net-ipfs-http-client) - A .Net client library for the IPFS HTTP API.
- [IPFS HTTP Gateway](https://github.com/richardschneider/net-ipfs-http-gateway) - Serves IPFS files/directories via HTTP.
- [Peer Talk](https://github.com/richardschneider/peer-talk) - Peer to peer communication.

## Sponsors
<img src="doc/images/atlascity.io-logo.png" width="200" alt="https://atlascity.io" />
Expand Down
6 changes: 4 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ build_script:

test_script:
- dotnet test --logger "console;verbosity=normal" -c %CONFIGURATION% --no-build --no-restore test
- dotnet tool install --global --ignore-failed-sources --add-source .\IpfsCli\bin\Release csipfs
- csipfs --help

after_test:
# Generate coverage report
Expand All @@ -67,9 +69,9 @@ after_test:
- if defined git_token gh-pages -d doc\_site -m "new docs %GitVersion_FullSemVer%"

artifacts:
- path: 'src/**/*.nupkg'
- path: './**/*.nupkg'
name: nupkg
- path: 'src/**/*.snupkg'
- path: './**/*.snupkg'
name: snupkg

# publish NuGet package on tag build
Expand Down
59 changes: 59 additions & 0 deletions doc/articles/csipfs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# IPFS CLI

## Install

The `csipfs` tool is available on [Nuget](https://www.nuget.org/packages/csipfs/) and
is installed with dotnet.

> dotnet tool install --global csipfs

## Usage

`csipfs` is a tool to control your IPFS node.

```
> csipfs --help
Usage: csipfs [options] [command]
Options:
--version Show version information
--help Show help information
--api <url> Use a specific API instance
-L|--local Run the command locally, instead of using the daemon
--enc The output type (json, xml, or text)
--debug Show debugging info
--trace Show tracing info
--time Show how long the command took
Commands:
add Add a file to IPFS
bitswap Manage swapped blocks
block Manage raw blocks
bootstrap Manage bootstrap peers
cat Show IPFS file data
config Manage the configuration
daemon Start a long running IPFS deamon
dht Query the DHT for values or peers
dns Resolve DNS link
files Manage the mfs (Mutable File System) [WIP]
get Download IPFS data
id Show info on an IPFS peer
init Initialize ipfs local configuration [WIP]
key Manage private keys
ls List links
name Manage IPNS names
object Manage IPFS objects
pin Manage data in local storage [WIP]
pubsub Publish/subscribe to messages on a given topic
refs List hashes of links [WIP]
repo Manage the IPFS repository
resolve Resolve any type of name
shutdown Stop the IPFS deamon
stats Query IPFS statistics
swarm Manage connections to the p2p network
update Download the latest version [WIP]
version Show version information
Run 'csipfs [command] --help' for more information about a command.
```
8 changes: 5 additions & 3 deletions doc/articles/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ package is published on [NuGet](https://www.nuget.org/packages/Ipfs.Engine).

## Related projects

- [IPFS Core](https://github.com/richardschneider/net-ipfs-core)
- [IPFS HTTP Client](https://github.com/richardschneider/net-ipfs-http-client)
- [Peer Talk](https://github.com/richardschneider/peer-talk)
- [IPFS Core](https://github.com/richardschneider/net-ipfs-core) - Core IPFS objects and interfaces.
- [IPFS DSL](https://github.com/cloveekprojeqt/ipfs-dsl) - A declarative embedded language for building compositional programs and protocols over the InterPlanetary File System.
- [IPFS HTTP Client](https://github.com/richardschneider/net-ipfs-http-client) - A .Net client library for the IPFS HTTP API.
- [IPFS HTTP Gateway](https://github.com/richardschneider/net-ipfs-http-gateway) - Serves IPFS files/directories via HTTP.
- [Peer Talk](https://github.com/richardschneider/peer-talk) - Peer to peer communication.

## Other implementations

Expand Down
2 changes: 2 additions & 0 deletions doc/articles/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
href: intro-ipfs.md
- name: Questions
href: questions.md
- name: IPFS command line
href: csipfs.md
- name: Features
href: core-api.md
- name: File System
Expand Down

0 comments on commit c9d16d0

Please sign in to comment.