Partager via


[Orchard 강좌] 32. Command-Line Interface 사용하기

이 내용은 ASP.NET MVP로 활동하고 계신 박용준님이 작성하신, 오픈소스 기반 웹사이트 제작 엔진인 Orchard로 처음 웹사이트를 구축 및 개발하기 위한 시리즈 강좌입니다. 많은 도움 되시길 바랍니다.
==================================================================================================

소개

본 강좌는 지난 번 다뤄본 Orchard.exe에 대한 내용과 중복되는 내용입니다.

Orchard.exe

Orchard CMS는 웹에서 대부분을 관리하는 기능을 제공합니다. 하지만, 웹이 아닌 데스크톱 환경에서 추가적인 기능을 확장한다거나, Orchard에 대한 관리를 하고자할 때 유용하게 사용할 수 있는 명령줄 도구인 Orchard.exe 파일을 제공합니다.

이 도구는 Orchard 웹 사이트의 bin 폴더에 위치합니다. Windows 탐색기를 사용하여 Orchard.exe 파일을 열려면, bin 폴더에 SHIFT 버튼을 누른 후 마우스 오른쪽 버튼을 클릭하면, [여기서 명령 창 열기] 메뉴가 나타납니다. 이를 선택하면, 아래 그림처럼 bin 폴더까지 도스창을 열어 볼 수 있습니다.(경우에 따라서는 직접 타이핑해서 들어와도 무관합니다.)

그런 후 Orchard.exe 명령어를 타이핑 후 엔터 키를 입력하면, Orchard 명령 프롬프트가 열립니다.

orchard_cmd_line_thumb.png

Orchard에 대한 도움말

Orchard.exe 실행 후 관련된 도움말을 살펴보려면, 아래 그림과 같이 “help commands” 명령어를 입력합니다.

help_commands_initial_thumb.png

Orchard.exe가 실행 중일 때에는 Orchard 소스를 가지고, 명령 프롬프트 환경에서 Orchard CMS를 설치할 수도 있습니다.

setup_cmd_thumb.png

도움말 목록

아래 리스트는 주요 명령어에 대한 샘플 도움말을 나타냅니다.

orchard> help commands
List of available commands:
---------------------------

blog create /Slug:<slug> /Title:<title> /Owner:<username> [/MenuText:<menu text>]
        Creates a new Blog

blog import /Slug:<slug> /FeedUrl:<feed url> /Owner:<username>
        Import all items from <feed url> into the blog at the specified <slug>

cultures get site culture
        Get culture for the site

cultures list
        List site cultures

cultures set site culture <culture-name>
        Set culture for the site

feature disable <feature-name-1> ... <feature-name-n>
        Disable one or more features

feature enable <feature-name-1> ... <feature-name-n>
        Enable one or more features

feature list [/Summary:true|false]
        Display list of available features

help <command>
        Display help text for <command>

help commands
        Display help text for all available commands

package create <extensionName> <path>
    Create a package for the extension <extensionName>
    (an extension being a module or a theme).
    The package will be output at the <path> specified.
    The default filename is Orchard.[Module|Theme].<extensionName>.<extensionVersion>.nupkg.
    For example, "package create SampleModule c:\temp" will create the package
    "c:\temp\Orchard.Module.SampleModule.1.0.0.nupkg".

package install <packageId> <location> /Version:<version>
        Install a module or a theme from a package file.

package uninstall <packageId>
    Uninstall a module or a theme.
    The <packageId> should take the format Orchard.[Module|Theme].<extensionName>.
    For example, "package uninstall Orchard.Module.SampleModule" will uninstall the Module under the "~/Modules/SampleModule" directory and
    "package uninstall Orchard.Theme.SampleTheme" will uninstall the Theme under the "~/Themes/SampleTheme" directory.

user create /UserName:<username> /Password:<password> /Email:<email>
        Creates a new User

도움말 사용 예

Orchard 에서 사용되는 특정 모듈 또는 테마에 대한 활성화/비활성화 여부를 목록으로 출력하고자 한다면, “feature list/Summary:true” 명령어로 실행할 수 있습니다. 또한, 비활성화 되어있는 feature(모듈/테마)에 대하여 활성화시키려면 “feature enable <feature-name>” 명령어 등을 사용할 수 있습니다.

끝.

관련글